summaryrefslogtreecommitdiff
path: root/src/basic/strv.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-23 01:01:26 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-29 21:08:37 +0200
commitfe382237cad0ade50d38075e0bf948ce07618461 (patch)
tree3a9b109b322c317276dccb1cb89446ddde7e6b32 /src/basic/strv.c
parent3ee897d6c2401effbc82f5eef35fce405781d6c8 (diff)
strv: add strv_free_free() to strv.c and make use of it
Let's teach it a new trick, and make it return NULL.
Diffstat (limited to 'src/basic/strv.c')
-rw-r--r--src/basic/strv.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/basic/strv.c b/src/basic/strv.c
index b9aef64b15..92f900936e 100644
--- a/src/basic/strv.c
+++ b/src/basic/strv.c
@@ -720,3 +720,16 @@ bool strv_fnmatch(char* const* patterns, const char *s, int flags) {
return false;
}
+
+char ***strv_free_free(char ***l) {
+ char ***i;
+
+ if (!l)
+ return NULL;
+
+ for (i = l; *i; i++)
+ strv_free(*i);
+
+ free(l);
+ return NULL;
+}