mirror of
https://github.com/systemd/systemd.git
synced 2025-03-22 06:50:18 +03:00
strv: return NULL from strv_free()
We always return NULL/invalid-object from destructors, fix strv_free() to do the same.
This commit is contained in:
parent
e0d065d405
commit
33c2ce7b20
@ -80,9 +80,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) {
|
||||
|
@ -31,7 +31,7 @@ char *strv_find(char **l, const char *name) _pure_;
|
||||
char *strv_find_prefix(char **l, const char *name) _pure_;
|
||||
char *strv_find_startswith(char **l, const char *name) _pure_;
|
||||
|
||||
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…
x
Reference in New Issue
Block a user