summaryrefslogtreecommitdiffstats
path: root/abs/extra/policykit/entry-leak.patch
blob: f6b3295943732cbc4aa1cd4b8a924441e975018d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
diff -up PolicyKit-0.9/src/polkit/polkit-policy-file-entry.c.entry-leak PolicyKit-0.9/src/polkit/polkit-policy-file-entry.c
--- PolicyKit-0.9/src/polkit/polkit-policy-file-entry.c.entry-leak	2008-08-29 21:47:22.000000000 -0400
+++ PolicyKit-0.9/src/polkit/polkit-policy-file-entry.c	2008-08-29 21:50:13.000000000 -0400
@@ -95,9 +95,11 @@ _polkit_policy_file_entry_new   (const c
         char *contents;
         size_t contents_size;
         PolKitPolicyFileEntry *pfe;
+        char **tokens;
 
         path = NULL;
         contents = NULL;
+        tokens = NULL;
 
         kit_return_val_if_fail (action_id != NULL && polkit_action_validate_id (action_id), NULL);
 
@@ -153,7 +155,6 @@ _polkit_policy_file_entry_new   (const c
         }
 
         if (contents != NULL) {
-                char **tokens;
                 size_t num_tokens;
                 PolKitResult any;
                 PolKitResult inactive;
@@ -183,11 +184,13 @@ _polkit_policy_file_entry_new   (const c
 
         kit_free (path);
         kit_free (contents);
+        kit_strfreev (tokens);
 
         return pfe;
 error:
         kit_free (path);
         kit_free (contents);
+        kit_strfreev (tokens);
         if (pfe != NULL)
                 polkit_policy_file_entry_unref (pfe);
         return NULL;