summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-02-28 16:55:18 +0100
committerMartin Pitt <martinpitt@users.noreply.github.com>2017-02-28 16:55:18 +0100
commit523f8cde4cf4d8b4027db83007dede5f379e3787 (patch)
tree4ce61864d9d973f3f5591ed58c9ff421ec23e927
parentf4ad4d658da2ed384579ed2e2b909a6558398919 (diff)
systemctl: fix bad memory access when mangle_names() fails (#5485)
Fixes #5483
-rw-r--r--src/systemctl/systemctl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 157a46865f..d78e56d777 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5964,6 +5964,7 @@ static int mangle_names(char **original_names, char ***mangled_names) {
} else {
r = unit_name_mangle(*name, UNIT_NAME_NOGLOB, i);
if (r < 0) {
+ *i = NULL;
strv_free(l);
return log_error_errno(r, "Failed to mangle unit name: %m");
}