lsfd: fix memory leak in append_filter_expr()

(cherry picked from commit f90264c6409a9e41d1130bc4be6b1a5bdc37cd96)
This commit is contained in:
liuh 2024-04-29 16:02:30 +08:00 committed by openeuler-sync-bot
parent 5d59161006
commit 3fa1484908
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,25 @@
From 53bcec4b25a60c125403a80a18ca3aacf1dc8269 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 25 Apr 2024 15:12:56 +0800
Subject: [PATCH] lsfd: fix memory leak in append_filter_expr()
---
misc-utils/lsfd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/misc-utils/lsfd.c b/misc-utils/lsfd.c
index 9f74862..56c0f7a 100644
--- a/misc-utils/lsfd.c
+++ b/misc-utils/lsfd.c
@@ -1590,6 +1590,8 @@ static void append_filter_expr(char **a, const char *b, bool and)
xstrappend(a, "or(");
xstrappend(a, b);
xstrappend(a, ")");
+
+ free(tmp);
}
static struct lsfd_filter *new_filter(const char *expr, bool debug, const char *err_prefix, struct lsfd_control *ctl)
--
2.27.0

View File

@ -3,7 +3,7 @@
Name: util-linux
Version: 2.39.1
Release: 6
Release: 7
Summary: A random collection of Linux utilities
License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain
URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git
@ -30,6 +30,7 @@ Patch6008: backport-CVE-2024-28085.patch
Patch6009: backport-tests-test_mkfds-netlink-pass-a-correct-file-descrip.patch
Patch6010: backport-tests-functions.sh-add-a-helper-funcion-making-a-dev.patch
Patch6011: backport-tests-lsfd-don-t-refer-on-the-line-follwoing-the-use.patch
Patch6012: backport-lsfd-fix-memory-leak-in-append_filter_expr.patch
Patch9000: SKIPPED-no-root-permissions-test.patch
%ifarch sw_64
@ -414,6 +415,12 @@ fi
%endif
%changelog
* Thu Apr 25 2024 liuh <liuhuan01@kylinos.cn> - 2.39.1-7
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:fix memory leak in append_filter_expr()
* Mon Apr 15 2024 zhangyao <zhangyao108@huawei.com> - 2.39.1-6
- Type:bugfix
- CVE:NA