From: Lennart Poettering Date: Tue, 28 Feb 2017 15:55:18 +0000 (+0100) Subject: systemctl: fix bad memory access when mangle_names() fails (#5485) X-Git-Tag: v233~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=523f8cde4cf4d8b4027db83007dede5f379e3787;p=thirdparty%2Fsystemd.git systemctl: fix bad memory access when mangle_names() fails (#5485) Fixes #5483 --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 157a46865ff..d78e56d777e 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"); }