38 lines
1.1 KiB
Diff
38 lines
1.1 KiB
Diff
|
|
From d0e16077d4ded64bbc878d29e0dc22b1f5e0912f Mon Sep 17 00:00:00 2001
|
||
|
|
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
|
||
|
|
Date: Mon, 3 May 2021 17:10:55 +0200
|
||
|
|
Reference:https://github.com/SELinuxProject/selinux/commit/d0e16077d4ded64bbc878d29e0dc22b1f5e0912f
|
||
|
|
Conflict:adapter filepath
|
||
|
|
Subject: [PATCH] libselinux: getconlist: free memory on multiple level
|
||
|
|
arguments
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
Do not leak memory if the program argument `l` got passed more than
|
||
|
|
once.
|
||
|
|
|
||
|
|
Found by clang-analyzer.
|
||
|
|
|
||
|
|
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
|
||
|
|
Signed-off-by: luhuaxin <1539327763@qq.com>
|
||
|
|
---
|
||
|
|
libselinux/utils/getconlist.c | 1 +
|
||
|
|
1 file changed, 1 insertion(+)
|
||
|
|
|
||
|
|
diff --git a/utils/getconlist.c b/utils/getconlist.c
|
||
|
|
index 76654b7..0bb2846 100644
|
||
|
|
--- a/utils/getconlist.c
|
||
|
|
+++ b/utils/getconlist.c
|
||
|
|
@@ -26,6 +26,7 @@ int main(int argc, char **argv)
|
||
|
|
while ((opt = getopt(argc, argv, "l:")) > 0) {
|
||
|
|
switch (opt) {
|
||
|
|
case 'l':
|
||
|
|
+ free(level);
|
||
|
|
level = strdup(optarg);
|
||
|
|
if (!level) {
|
||
|
|
fprintf(stderr, "memory allocation failure: %d(%s)\n",
|
||
|
|
--
|
||
|
|
1.8.3.1
|
||
|
|
|