]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared: Fix memory leak in bus_append_execute_property()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 9 May 2022 07:50:32 +0000 (09:50 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 9 May 2022 09:58:55 +0000 (18:58 +0900)
Fixes #23317

src/shared/bus-unit-util.c

index d78d75bf0f858e1b465f4a66df9cdb8b6a60ee84..a326ca30a9a49c1edd4ec6d9339897149afddc2f 100644 (file)
@@ -1955,7 +1955,7 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
                         path_simplify(source);
 
                         if (isempty(destination)) {
-                                r = strv_extend(&sources, TAKE_PTR(source));
+                                r = strv_consume(&sources, TAKE_PTR(source));
                                 if (r < 0)
                                         return bus_log_create_error(r);
                         } else {