Blame SOURCES/0006-libsemanage-Free-contents-of-modkey-in-semanage_dire.patch

634418
From e14a8a078b2cfecb0498ff98ddff08403b3be1cd Mon Sep 17 00:00:00 2001
634418
From: Jakub Hrozek <jhrozek@redhat.com>
634418
Date: Thu, 17 Dec 2020 15:59:49 +0100
634418
Subject: [PATCH] libsemanage: Free contents of modkey in
634418
 semanage_direct_remove
634418
634418
semanage_direct_remove allocates struct semanage_module_key_t on
634418
stack, then calls semanage_module_key_set_name which allocates
634418
modkey->name on heap, but modkey->name wasn't free()-d anywhere,
634418
creating a small leak.
634418
634418
Signed-off-by: Jakub Hrozek <jhrozek@redhat.com>
634418
---
634418
 libsemanage/src/direct_api.c | 1 +
634418
 1 file changed, 1 insertion(+)
634418
634418
diff --git a/libsemanage/src/direct_api.c b/libsemanage/src/direct_api.c
634418
index b037890a..c32939c0 100644
634418
--- a/libsemanage/src/direct_api.c
634418
+++ b/libsemanage/src/direct_api.c
634418
@@ -1944,6 +1944,7 @@ static int semanage_direct_remove(semanage_handle_t * sh, char *module_name)
634418
 	status = semanage_direct_remove_key(sh, &modkey);
634418
 
634418
 cleanup:
634418
+	semanage_module_key_destroy(sh, &modkey);
634418
 	return status;
634418
 }
634418
 
634418
-- 
634418
2.30.2
634418