mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-31 18:01:46 +00:00
libsemanage: Fix null pointer dereference in semanage_module_key_destroy
If modkey is NULL, semanage_module_key_destroy() would still try to initialize a modkey after freeing it. Signed-off-by: Yuli Khodorkovskiy <ykhodorkovskiy@tresys.com> Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
This commit is contained in:
parent
228261a51a
commit
d4f3ba7c50
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user