summaryrefslogtreecommitdiff
path: root/src/basic/strv.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-02-21 11:11:44 +0100
committerGitHub <noreply@github.com>2017-02-21 11:11:44 +0100
commita4dde27d73c1d8219c0cc6390ef8b6e15b347edb (patch)
tree08bcdb6b3af043fa714d7ef413583b0c66181ec3 /src/basic/strv.c
parent012f2b7de7137afbe7d1529ad670f51e4448b363 (diff)
parentf50ce8fc4b2619d73b3118ea202b112035e713c1 (diff)
Merge pull request #5131 from keszybz/environment-generators
Environment generators
Diffstat (limited to 'src/basic/strv.c')
-rw-r--r--src/basic/strv.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/basic/strv.c b/src/basic/strv.c
index 0eec868eed..60f92e6373 100644
--- a/src/basic/strv.c
+++ b/src/basic/strv.c
@@ -564,9 +564,6 @@ int strv_extend_front(char ***l, const char *value) {
/* Like strv_extend(), but prepends rather than appends the new entry */
- if (!value)
- return 0;
-
n = strv_length(*l);
/* Increase and overflow check. */
@@ -574,9 +571,12 @@ int strv_extend_front(char ***l, const char *value) {
if (m < n)
return -ENOMEM;
- v = strdup(value);
- if (!v)
- return -ENOMEM;
+ if (value) {
+ v = strdup(value);
+ if (!v)
+ return -ENOMEM;
+ } else
+ v = NULL;
c = realloc_multiply(*l, sizeof(char*), m);
if (!c) {