diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-01-28 19:36:48 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-01-29 19:01:41 -0500 |
commit | e3ded78be7df143ba780dd55ca8897fdddd67460 (patch) | |
tree | 6a82c7e12a003c909a667e5b26bef6a83ad8affb /src/shared/set.c | |
parent | 01233fc71296bc78c2de14b755236ced752500f7 (diff) |
shared: introduce _cleanup_set_free_free_
Diffstat (limited to 'src/shared/set.c')
-rw-r--r-- | src/shared/set.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shared/set.c b/src/shared/set.c index 53399b655b..cd910d70ab 100644 --- a/src/shared/set.c +++ b/src/shared/set.c @@ -49,6 +49,14 @@ void set_free_free(Set *s) { hashmap_free_free(MAKE_HASHMAP(s)); } +void set_free_freep(Set **s) { + if (!*s) + return; + + set_free_free(*s); + *s = NULL; +} + int set_ensure_allocated(Set **s, hash_func_t hash_func, compare_func_t compare_func) { return hashmap_ensure_allocated((Hashmap**) s, hash_func, compare_func); } |