From: Zbigniew Jędrzejewski-Szmek Date: Thu, 14 Apr 2016 01:11:28 +0000 (-0400) Subject: systemctl: fix leak X-Git-Tag: v230~183^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3033%2Fhead;p=thirdparty%2Fsystemd.git systemctl: fix leak CID #1354670. --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 65b52be04a3..91829fcbcf6 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -6087,8 +6087,7 @@ static int find_paths_to_edit(sd_bus *bus, char **names, char ***paths) { return r; STRV_FOREACH(name, names) { - _cleanup_free_ char *path = NULL; - char *new_path, *tmp_path; + _cleanup_free_ char *path = NULL, *new_path = NULL, *tmp_path = NULL; r = unit_find_paths(bus, *name, &lp, &path, NULL); if (r < 0) @@ -6111,6 +6110,7 @@ static int find_paths_to_edit(sd_bus *bus, char **names, char ***paths) { r = strv_push_pair(paths, new_path, tmp_path); if (r < 0) return log_oom(); + new_path = tmp_path = NULL; } return 0;