shared: check strdup != NULL

This is a follow-up for dc7dd61de6
This commit is contained in:
Evgeny Vereshchagin 2017-01-09 22:45:41 +00:00
parent 8af35ba681
commit d054eae6c9

View file

@ -1893,7 +1893,11 @@ int unit_file_unmask(
if (!GREEDY_REALLOC0(todo, n_allocated, n_todo + 2))
return -ENOMEM;
todo[n_todo++] = strdup(*i);
todo[n_todo] = strdup(*i);
if (!todo[n_todo])
return -ENOMEM;
n_todo++;
}
strv_uniq(todo);