]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/dbus: fix two strv memleaks
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 25 Jan 2017 03:21:16 +0000 (22:21 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 25 Jan 2017 03:21:16 +0000 (22:21 -0500)
job_dbus_path and unit_dbus_path both allocate new strings, so we should use
strv_free.

src/core/dbus.c

index 1f9bf2085f7ae55d836c59cc4c4fef21fb950177..a3f701c064598c1c27c8b0b727490879f4a4aa27 100644 (file)
@@ -477,7 +477,7 @@ static int bus_kill_context_find(sd_bus *bus, const char *path, const char *inte
 }
 
 static int bus_job_enumerate(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error) {
-        _cleanup_free_ char **l = NULL;
+        _cleanup_strv_free_ char **l = NULL;
         Manager *m = userdata;
         unsigned k = 0;
         Iterator i;
@@ -504,7 +504,7 @@ static int bus_job_enumerate(sd_bus *bus, const char *path, void *userdata, char
 }
 
 static int bus_unit_enumerate(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error) {
-        _cleanup_free_ char **l = NULL;
+        _cleanup_strv_free_ char **l = NULL;
         Manager *m = userdata;
         unsigned k = 0;
         Iterator i;