mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-28 00:42:07 +00:00
libsemanage: fcontext_record: do not leak on error in semanage_fcontext_key_create
If the strdup failed, we would return without freeing tmp_key. This is obviously a memory leak. So free that if we are finished with it. Signed-off-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
parent
7d83d86ba1
commit
d0c7f6ea4f
@ -48,6 +48,7 @@ int semanage_fcontext_key_create(semanage_handle_t * handle,
|
||||
tmp_key->expr = strdup(expr);
|
||||
if (!tmp_key->expr) {
|
||||
ERR(handle, "out of memory, could not create file context key.");
|
||||
free(tmp_key);
|
||||
return STATUS_ERR;
|
||||
}
|
||||
tmp_key->type = type;
|
||||
|
Loading…
Reference in New Issue
Block a user