#undef EXEC_CONTEXT_CONFIG_ITEMS
const char *sections[3];
- char *k;
int r;
Set *symlink_names;
FILE *f = NULL;
r = 0;
finish:
- while ((k = set_steal_first(symlink_names)))
- free(k);
-
- set_free(symlink_names);
+ set_free_free(symlink_names);
free(filename);
if (f)
hashmap_free(MAKE_HASHMAP(s));
}
+void set_free_free(Set *s) {
+ void *p;
+
+ while ((p = set_steal_first(s)))
+ free(p);
+
+ set_free(s);
+}
+
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);
}
Set *set_new(hash_func_t hash_func, compare_func_t compare_func);
void set_free(Set* s);
+void set_free_free(Set *s);
Set* set_copy(Set *s);
int set_ensure_allocated(Set **s, hash_func_t hash_func, compare_func_t compare_func);
free(u->meta.description);
free(u->meta.fragment_path);
- while ((t = set_steal_first(u->meta.names)))
- free(t);
- set_free(u->meta.names);
+ set_free_free(u->meta.names);
free(u->meta.instance);
complete_move(&u->meta.names, &other->meta.names);
- while ((t = set_steal_first(other->meta.names)))
- free(t);
-
- set_free(other->meta.names);
+ set_free_free(other->meta.names);
other->meta.names = NULL;
other->meta.id = NULL;