diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-09-08 18:43:11 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-09-09 08:19:27 +0200 |
commit | a1e58e8ee1c84b633d6d6d651d5328d4dd4eba5b (patch) | |
tree | 2c5288c0e505c561c779ea13b4d99e8101803ca2 /src/login | |
parent | da323858ef34a0216aa96f4089810053c90f09ce (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/login')
-rw-r--r-- | src/login/logind-dbus.c | 3 | ||||
-rw-r--r-- | src/login/logind-inhibit.c | 3 | ||||
-rw-r--r-- | src/login/logind-session.c | 3 | ||||
-rw-r--r-- | src/login/logind-user.c | 3 |
4 files changed, 4 insertions, 8 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index b6fa50aa52..050d0252ad 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -1987,8 +1987,7 @@ static int method_cancel_scheduled_shutdown(sd_bus_message *message, void *userd m->scheduled_shutdown_timeout_source = sd_event_source_unref(m->scheduled_shutdown_timeout_source); m->wall_message_timeout_source = sd_event_source_unref(m->wall_message_timeout_source); m->nologin_timeout_source = sd_event_source_unref(m->nologin_timeout_source); - free(m->scheduled_shutdown_type); - m->scheduled_shutdown_type = NULL; + m->scheduled_shutdown_type = mfree(m->scheduled_shutdown_type); m->scheduled_shutdown_timeout = 0; if (m->unlink_nologin) { diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index cfae186edd..0c9c1e5e97 100644 --- a/src/login/logind-inhibit.c +++ b/src/login/logind-inhibit.c @@ -333,8 +333,7 @@ void inhibitor_remove_fifo(Inhibitor *i) { if (i->fifo_path) { unlink(i->fifo_path); - free(i->fifo_path); - i->fifo_path = NULL; + i->fifo_path = mfree(i->fifo_path); } } diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 92a6027a7e..d2c5a29801 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -913,8 +913,7 @@ static void session_remove_fifo(Session *s) { if (s->fifo_path) { unlink(s->fifo_path); - free(s->fifo_path); - s->fifo_path = NULL; + s->fifo_path = mfree(s->fifo_path); } } diff --git a/src/login/logind-user.c b/src/login/logind-user.c index 5d8a7571cd..f2c89e3653 100644 --- a/src/login/logind-user.c +++ b/src/login/logind-user.c @@ -560,8 +560,7 @@ static int user_remove_runtime_path(User *u) { if (r < 0) log_error_errno(r, "Failed to remove runtime directory %s: %m", u->runtime_path); - free(u->runtime_path); - u->runtime_path = NULL; + u->runtime_path = mfree(u->runtime_path); return r; } |