Fix memleak
This commit is contained in:
parent
ce4156b3dd
commit
11bf124056
29
21705.patch
Normal file
29
21705.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From ca52de3b56d5e70232bee29314cd84f5596c1e7f Mon Sep 17 00:00:00 2001
|
||||
From: Daan De Meyer <daan.j.demeyer@gmail.com>
|
||||
Date: Thu, 9 Dec 2021 15:46:13 +0100
|
||||
Subject: [PATCH] process-util: Fix memory leak
|
||||
|
||||
---
|
||||
src/basic/process-util.c | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
|
||||
index 1b96d3ca8543..c97185215847 100644
|
||||
--- a/src/basic/process-util.c
|
||||
+++ b/src/basic/process-util.c
|
||||
@@ -221,9 +221,12 @@ int get_process_cmdline(pid_t pid, size_t max_columns, ProcessCmdlineFlags flags
|
||||
return -ENOMEM;
|
||||
|
||||
/* Drop trailing empty strings. See issue #21186. */
|
||||
- STRV_FOREACH_BACKWARDS(p, args)
|
||||
- if (isempty(*p))
|
||||
- *p = mfree(*p);
|
||||
+ STRV_FOREACH_BACKWARDS(p, args) {
|
||||
+ if (!isempty(*p))
|
||||
+ break;
|
||||
+
|
||||
+ *p = mfree(*p);
|
||||
+ }
|
||||
|
||||
ans = quote_command_line(args, shflags);
|
||||
if (!ans)
|
@ -92,6 +92,7 @@ GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[
|
||||
# here, rather than in the next section. Packit CI will drop any
|
||||
# patches in this range before applying upstream pull requests.
|
||||
|
||||
Patch0001: https://github.com/systemd/systemd/pull/21705.patch
|
||||
|
||||
# Downstream-only patches (5000–9999)
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1738828
|
||||
|
Loading…
Reference in New Issue
Block a user