From ff1acaf3c4473369707f19ac2fc132556c858db4 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 12 Apr 2015 17:01:34 -0400 Subject: 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 --- src/shared/strv.c | 3 ++- src/shared/strv.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/shared') diff --git a/src/shared/strv.c b/src/shared/strv.c index 5cfab8f23e..1f73134756 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 94bdbe62aa..ed0bb2e372 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) -- cgit v1.2.3-54-g00ecf