diff options
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/strv.c | 13 | ||||
-rw-r--r-- | src/basic/strv.h | 2 |
2 files changed, 15 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; +} diff --git a/src/basic/strv.h b/src/basic/strv.h index f07da8cdf3..713e91f8f8 100644 --- a/src/basic/strv.h +++ b/src/basic/strv.h @@ -154,3 +154,5 @@ static inline bool strv_fnmatch_or_empty(char* const* patterns, const char *s, i return strv_isempty(patterns) || strv_fnmatch(patterns, s, flags); } + +char ***strv_free_free(char ***l); |