diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-04-13 21:11:28 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-04-13 21:11:28 -0400 |
commit | 78df0edc1b594017b1d3493eb2033d8a92d9d43f (patch) | |
tree | 9c300607edcc313f8e544c576028cb81e87a3b4f /src/systemctl/systemctl.c | |
parent | e215d211d25139a46970101525ebdde874daf2f0 (diff) |
systemctl: fix leak
CID #1354670.
Diffstat (limited to 'src/systemctl/systemctl.c')
-rw-r--r-- | src/systemctl/systemctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 65b52be04a..91829fcbcf 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; |