strv: return NULL from strv_free()

We always return NULL/invalid-object from destructors, fix strv_free() to
do the same.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
This commit is contained in:
David Herrmann 2015-04-12 17:01:34 -04:00 committed by Anthony G. Basile
parent 36f74863ad
commit ff1acaf3c4
2 changed files with 3 additions and 2 deletions

View File

@ -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) {

View File

@ -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)