chiark / gitweb /
shared: remove pointless checks in auto-cleanup functions
authorMichal Schmidt <mschmidt@redhat.com>
Wed, 6 Mar 2013 13:17:59 +0000 (14:17 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Fri, 8 Mar 2013 09:09:31 +0000 (10:09 +0100)
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().


No differences found