summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index 56f2c92feb..d918007bb8 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -674,8 +674,7 @@ static int manager_setup_notify(Manager *m) {
static const int one = 1;
/* First free all secondary fields */
- free(m->notify_socket);
- m->notify_socket = NULL;
+ m->notify_socket = mfree(m->notify_socket);
m->notify_event_source = sd_event_source_unref(m->notify_event_source);
fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
@@ -2793,10 +2792,8 @@ static void trim_generator_dir(Manager *m, char **generator) {
if (!*generator)
return;
- if (rmdir(*generator) >= 0) {
- free(*generator);
- *generator = NULL;
- }
+ if (rmdir(*generator) >= 0)
+ *generator = mfree(*generator);
return;
}
@@ -2866,8 +2863,7 @@ static void remove_generator_dir(Manager *m, char **generator) {
strv_remove(m->lookup_paths.unit_path, *generator);
(void) rm_rf(*generator, REMOVE_ROOT);
- free(*generator);
- *generator = NULL;
+ *generator = mfree(*generator);
}
static void manager_undo_generators(Manager *m) {