diff options
author | Evgeny Vereshchagin <evvers@ya.ru> | 2017-01-09 22:45:41 +0000 |
---|---|---|
committer | Evgeny Vereshchagin <evvers@ya.ru> | 2017-01-09 22:45:41 +0000 |
commit | d054eae6c954baa857170bb60072c8a2ecea0d6b (patch) | |
tree | 1174048d0b703396610bb6a018095b8466d9a2df | |
parent | 8af35ba681116eb79a46e3dbd65b166c1efd6164 (diff) |
shared: check strdup != NULL
This is a follow-up for dc7dd61de610e9330
-rw-r--r-- | src/shared/install.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shared/install.c b/src/shared/install.c index b7e8f14531..478abac8ab 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -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); |