handle kit_strdup failure.
authorJim Meyering <meyering@redhat.com>
Tue, 4 Mar 2008 13:21:29 +0000 (14:21 +0100)
committerDavid Zeuthen <davidz@redhat.com>
Tue, 4 Mar 2008 21:26:11 +0000 (16:26 -0500)
* tools/polkit-policy-file-validate.c (validate_file):

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: David Zeuthen <davidz@redhat.com>
tools/polkit-policy-file-validate.c

index c70de17..e77bbdd 100644 (file)
@@ -99,7 +99,8 @@ validate_file (const char *file)
                 basename++;
         else
                 basename = file;
-        prefix = kit_strdup (basename);
+        if ((prefix = kit_strdup (basename)) == NULL)
+                goto out;
         /* strip out "policy" - retain the dot */
         prefix [strlen (prefix) - 6] = '\0';