mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-11-23 23:10:57 +07:00
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:
parent
36f74863ad
commit
ff1acaf3c4
@ -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) {
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user