If modkey is NULL, semanage_module_key_destroy() would still try to initialize a modkey after freeing it. Signed-off-by: Yuli Khodorkovskiy <ykhodorkovskiy@xxxxxxxxxx> --- libsemanage/src/modules.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libsemanage/src/modules.c b/libsemanage/src/modules.c index 131f502..90c5e49 100644 --- a/libsemanage/src/modules.c +++ b/libsemanage/src/modules.c @@ -690,10 +690,12 @@ int semanage_module_key_destroy(semanage_handle_t *sh, { assert(sh); - if (modkey) { - free(modkey->name); + if (!modkey) { + return 0; } + free(modkey->name); + return semanage_module_key_init(sh, modkey); } -- 1.9.3 _______________________________________________ Selinux mailing list Selinux@xxxxxxxxxxxxx To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx. To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.