From: Aleksei Nikiforov Date: Tue, 4 Aug 2020 07:24:46 +0000 (+0300) Subject: Fix potential resource leak in set_selinux_file_context function X-Git-Tag: v4.9~65^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F270%2Fhead;p=thirdparty%2Fshadow.git Fix potential resource leak in set_selinux_file_context function --- 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; } }