Projects
openEuler:22.03:LTS:LoongArch
libselinux
_service:tar_scm_kernel_repo:backport-libselinu...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm_kernel_repo:backport-libselinux-free-memory-in-error-branch.patch of Package libselinux
From 8266fd9401b920bd3552410ebe215069891c373f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com> Date: Tue, 10 May 2022 19:45:51 +0200 Subject: [PATCH] libselinux: free memory in error branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In case the allocation for the filename fails, free the memory of the context. Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Acked-by: James Carter <jwcart2@gmail.com> --- src/selinux_restorecon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/selinux_restorecon.c b/src/selinux_restorecon.c index 12b85101..c8db26c2 100644 --- a/src/selinux_restorecon.c +++ b/src/selinux_restorecon.c @@ -487,11 +487,13 @@ static int filespec_add(ino_t ino, const char *con, const char *file, goto oom_freefl; fl->file = strdup(file); if (!fl->file) - goto oom_freefl; + goto oom_freeflcon; fl->next = prevfl->next; prevfl->next = fl; return 0; +oom_freeflcon: + free(fl->con); oom_freefl: free(fl); oom: -- 2.27.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.