summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorMichael Scherer <misc@zarb.org>2014-01-11 17:20:57 +0100
committerTom Gundersen <teg@jklm.no>2014-01-11 17:08:39 +0000
commit6c833cdfc36322cf77b83d3154bd216129352a3a (patch)
treef4935091a78db17bc689bc12c8658a8b44c617ad /src/core
parentec260edc1ca85a02f8a9e2e92401333ff986264b (diff)
make socket_instantiate_service use cleanup gcc attribute
Diffstat (limited to 'src/core')
-rw-r--r--src/core/socket.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index 88599ca9c1..1f2a2c0aaf 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -179,7 +179,8 @@ static int socket_arm_timer(Socket *s) {
}
static int socket_instantiate_service(Socket *s) {
- char *prefix, *name;
+ _cleanup_free_ char *prefix = NULL;
+ _cleanup_free_ char *name = NULL;
int r;
Unit *u;
@@ -199,13 +200,11 @@ static int socket_instantiate_service(Socket *s) {
return -ENOMEM;
r = asprintf(&name, "%s@%u.service", prefix, s->n_accepted);
- free(prefix);
if (r < 0)
return -ENOMEM;
r = manager_load_unit(UNIT(s)->manager, name, NULL, NULL, &u);
- free(name);
if (r < 0)
return r;