dryang / rpms / systemd

Forked from rpms/systemd a year ago
Clone
8d419f
From 18b0bc42dc097af6147324deef100c41dedfa755 Mon Sep 17 00:00:00 2001
8d419f
From: Daan De Meyer <daan.j.demeyer@gmail.com>
8d419f
Date: Mon, 9 May 2022 09:50:32 +0200
8d419f
Subject: [PATCH] shared: Fix memory leak in bus_append_execute_property()
8d419f
8d419f
Fixes #23317
8d419f
8d419f
(cherry picked from commit 2aaf6d407e8541985a15b7106abf6fbdfed0766a)
8d419f
Related: #2087652
8d419f
---
8d419f
 src/shared/bus-unit-util.c | 2 +-
8d419f
 1 file changed, 1 insertion(+), 1 deletion(-)
8d419f
8d419f
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c
8d419f
index dcce530c99..ef134bcee4 100644
8d419f
--- a/src/shared/bus-unit-util.c
8d419f
+++ b/src/shared/bus-unit-util.c
8d419f
@@ -1952,7 +1952,7 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
8d419f
                         path_simplify(source);
8d419f
 
8d419f
                         if (isempty(destination)) {
8d419f
-                                r = strv_extend(&sources, TAKE_PTR(source));
8d419f
+                                r = strv_consume(&sources, TAKE_PTR(source));
8d419f
                                 if (r < 0)
8d419f
                                         return bus_log_create_error(r);
8d419f
                         } else {