summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-12-23 21:07:07 +0100
committerLennart Poettering <lennart@poettering.net>2015-12-23 21:07:07 +0100
commitd6ef10fadfe757c8f0a5664097978b4f4d0f430e (patch)
treebd0a4ad99e11fc7d4f97fd855a78924138f4d1d1
parenta6cff5d3c0e9a5aef3f1440b089fdb9f30bf444f (diff)
parent0a78712e819f2db29809ec752bf96c2c1012a181 (diff)
Merge pull request #2214 from zonque/leak
Core: plug a memory leak in socket.c, and some related cleanups
-rw-r--r--src/core/socket.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index 7beec3644e..d6b0c963e8 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -156,14 +156,16 @@ static void socket_done(Unit *u) {
s->tcp_congestion = mfree(s->tcp_congestion);
s->bind_to_device = mfree(s->bind_to_device);
- free(s->smack);
- free(s->smack_ip_in);
- free(s->smack_ip_out);
+ s->smack = mfree(s->smack);
+ s->smack_ip_in = mfree(s->smack_ip_in);
+ s->smack_ip_out = mfree(s->smack_ip_out);
strv_free(s->symlinks);
- free(s->user);
- free(s->group);
+ s->user = mfree(s->user);
+ s->group = mfree(s->group);
+
+ s->fdname = mfree(s->fdname);
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
}