summaryrefslogtreecommitdiff
path: root/src/shared/set.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-07 11:43:41 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-07 11:43:41 -0500
commitbac3c8eefe23a820caac930d41629cebafbfc7b2 (patch)
tree75a3a43a24a58eeb0c1e9e47b1d32fcb33e4011f /src/shared/set.c
parent89db26a263480ccacfdad039063151ecb9a74f41 (diff)
localectl: use automatic cleanup
set_freep() is added to automatize set_free().
Diffstat (limited to 'src/shared/set.c')
-rw-r--r--src/shared/set.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shared/set.c b/src/shared/set.c
index 5f83c50839..53399b655b 100644
--- a/src/shared/set.c
+++ b/src/shared/set.c
@@ -37,6 +37,14 @@ void set_free(Set* s) {
hashmap_free(MAKE_HASHMAP(s));
}
+void set_freep(Set **s) {
+ if (!s)
+ return;
+
+ set_free(*s);
+ *s = NULL;
+}
+
void set_free_free(Set *s) {
hashmap_free_free(MAKE_HASHMAP(s));
}