Fix potential resource leak in set_selinux_file_context function
This commit is contained in:
parent
7ea342579e
commit
49930bd3a6
@ -70,6 +70,7 @@ int set_selinux_file_context (const char *dst_name)
|
|||||||
/* Set the security context for the next created file */
|
/* Set the security context for the next created file */
|
||||||
if (setfscreatecon (scontext) < 0) {
|
if (setfscreatecon (scontext) < 0) {
|
||||||
if (security_getenforce () != 0) {
|
if (security_getenforce () != 0) {
|
||||||
|
freecon (scontext);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user