summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-08 18:43:11 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-09 08:19:27 +0200
commita1e58e8ee1c84b633d6d6d651d5328d4dd4eba5b (patch)
tree2c5288c0e505c561c779ea13b4d99e8101803ca2 /src/core/manager.c
parentda323858ef34a0216aa96f4089810053c90f09ce (diff)
tree-wide: use coccinelle to patch a lot of code to use mfree()
This replaces this: free(p); p = NULL; by this: p = mfree(p); Change generated using coccinelle. Semantic patch is added to the sources.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index 56f2c92feb..cd0513fd69 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);
@@ -2794,8 +2793,7 @@ static void trim_generator_dir(Manager *m, char **generator) {
return;
if (rmdir(*generator) >= 0) {
- free(*generator);
- *generator = NULL;
+ *generator = mfree(*generator);
}
return;
@@ -2866,8 +2864,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) {