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