Fix memory leak on smack_cipso
authorZofia Abramowska <z.abramowska@samsung.com>
Fri, 22 Nov 2013 09:38:06 +0000 (10:38 +0100)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Fri, 22 Nov 2013 11:39:45 +0000 (13:39 +0200)
smack_cipso_free() didn't release main pointer, which was
inconsistent with header description and further usage in
apply_cipso_file().
(cherry picked from commit 6304f9a3f73312a7feb3b25fa593919744acb947)

libsmack/libsmack.c

index 192a2a0..934aa3c 100644 (file)
@@ -358,6 +358,8 @@ void smack_cipso_free(struct smack_cipso *cipso)
                free(mapping);
                mapping = next_mapping;
        }
+
+       free(cipso);
 }
 
 int smack_cipso_apply(struct smack_cipso *cipso)