From 5f1be48b264e4d556f688062cc6f4a1e03f9f455 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Wed, 6 Mar 2013 14:17:59 +0100 Subject: shared: remove pointless checks in auto-cleanup functions The argument given to the __attribute__((cleanup)) functions is the address of the variable that's going out of scope. It cannot be NULL. The "if (!s)" check in set_freep() is pointless. Perhaps "if (!*s)" was intented. But that's pointless too, because set_free()/set_free_free() are OK to call with a NULL argument (just like free()). Setting "*s = NULL" is pointless, because the variable that s points to is about to go out of scope. The same holds for strv_freep(). --- src/shared/strv.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/shared/strv.c') diff --git a/src/shared/strv.c b/src/shared/strv.c index 60c4762572..117382ed80 100644 --- a/src/shared/strv.c +++ b/src/shared/strv.c @@ -65,11 +65,7 @@ void strv_free(char **l) { } void strv_freep(char ***l) { - if (!l) - return; - strv_free(*l); - *l = NULL; } char **strv_copy(char **l) { -- cgit v1.2.3-54-g00ecf