summaryrefslogtreecommitdiff
path: root/src/basic/strv.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-09-09 09:57:29 +0200
committerDaniel Mack <github@zonque.org>2015-09-09 09:57:29 +0200
commit0fa7d1f5be847d4804eb3bf6a4c10333ea14e0bc (patch)
tree6afb70cc560bd94219f81495ff699c83b404e18c /src/basic/strv.c
parentbed2c013b6570908a114a337632000cf9c9de838 (diff)
parentece174c5439021e32ebcc858842de9586072c006 (diff)
Merge pull request #1207 from poettering/coccinelle-fixes
Coccinelle fixes
Diffstat (limited to 'src/basic/strv.c')
-rw-r--r--src/basic/strv.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/basic/strv.c b/src/basic/strv.c
index eaf440a4b2..b9aef64b15 100644
--- a/src/basic/strv.c
+++ b/src/basic/strv.c
@@ -270,10 +270,8 @@ char **strv_split_newlines(const char *s) {
if (n <= 0)
return l;
- if (isempty(l[n-1])) {
- free(l[n-1]);
- l[n-1] = NULL;
- }
+ if (isempty(l[n - 1]))
+ l[n - 1] = mfree(l[n - 1]);
return l;
}
@@ -292,9 +290,8 @@ int strv_split_extract(char ***t, const char *s, const char *separators, Extract
r = extract_first_word(&s, &word, separators, flags);
if (r < 0)
return r;
- if (r == 0) {
+ if (r == 0)
break;
- }
if (!GREEDY_REALLOC(l, allocated, n + 2))
return -ENOMEM;