chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
set: introduce set_free_free()
[elogind.git]
/
src
/
unit.c
diff --git
a/src/unit.c
b/src/unit.c
index 3bb41a42393880dd12c3899c72a220b09131e449..229f44c1a97459e17152bca68845bf62af344382 100644
(file)
--- a/
src/unit.c
+++ b/
src/unit.c
@@
-354,9
+354,7
@@
void unit_free(Unit *u) {
free(u->meta.description);
free(u->meta.fragment_path);
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);
free(u->meta.instance);
@@
-402,10
+400,7
@@
static void merge_names(Unit *u, Unit *other) {
complete_move(&u->meta.names, &other->meta.names);
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;
other->meta.names = NULL;
other->meta.id = NULL;