diff --git a/src/shared/strv.c b/src/shared/strv.c index 5cfab8f23..1f7313475 100644 --- a/src/shared/strv.c +++ b/src/shared/strv.c @@ -38,9 +38,10 @@ void strv_clear(char **l) { *l = NULL; } -void strv_free(char **l) { +char **strv_free(char **l) { strv_clear(l); free(l); + return NULL; } char **strv_copy(char * const *l) { diff --git a/src/shared/strv.h b/src/shared/strv.h index 94bdbe62a..ed0bb2e37 100644 --- a/src/shared/strv.h +++ b/src/shared/strv.h @@ -24,7 +24,7 @@ #include "util.h" -void strv_free(char **l); +char **strv_free(char **l); DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free); #define _cleanup_strv_free_ _cleanup_(strv_freep)