systemctl: fix bad memory access when mangle_names() fails (#5485)

Fixes #5483
This commit is contained in:
Lennart Poettering 2017-02-28 16:55:18 +01:00 committed by Martin Pitt
parent f4ad4d658d
commit 523f8cde4c
1 changed files with 1 additions and 0 deletions

View File

@ -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");
}