From fe382237cad0ade50d38075e0bf948ce07618461 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 23 Sep 2015 01:01:26 +0200 Subject: 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. --- src/basic/strv.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/basic/strv.c') 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; +} -- cgit v1.2.3-54-g00ecf