From 49930bd3a6d685d5ce1491a46df4dd44184804b1 Mon Sep 17 00:00:00 2001 From: Aleksei Nikiforov Date: Tue, 4 Aug 2020 10:24:46 +0300 Subject: [PATCH] Fix potential resource leak in set_selinux_file_context function --- lib/selinux.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/selinux.c b/lib/selinux.c index 8cc444f03..c60cbed51 100644 --- a/lib/selinux.c +++ b/lib/selinux.c @@ -70,6 +70,7 @@ int set_selinux_file_context (const char *dst_name) /* Set the security context for the next created file */ if (setfscreatecon (scontext) < 0) { if (security_getenforce () != 0) { + freecon (scontext); return 1; } } -- 2.39.5