chiark / gitweb /
shared: introduce _cleanup_set_free_free_
[elogind.git] / src / shared / set.c
index 53399b6..cd910d7 100644 (file)
@@ -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);
 }