summaryrefslogtreecommitdiff
path: root/src/core/socket.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-03-14 09:05:56 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-03-14 09:31:34 -0400
commit315db1a8aed226a51a4cf700172249cfd10ae115 (patch)
tree4b118f45a74c715ecdb3281e8a8e3f5ee9337d80 /src/core/socket.c
parentfe970a8a30d611d454cb40025cfc32e29efa34e6 (diff)
Do not return -1 (EINVAL) on allocation error
Diffstat (limited to 'src/core/socket.c')
-rw-r--r--src/core/socket.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index 8ecc9f9950..b39bec2f26 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -198,16 +198,14 @@ static int socket_instantiate_service(Socket *s) {
assert(s->accept);
- if (!(prefix = unit_name_to_prefix(UNIT(s)->id)))
+ prefix = unit_name_to_prefix(UNIT(s)->id);
+ if (!prefix)
return -ENOMEM;
- r = asprintf(&name, "%s@%u.service", prefix, s->n_accepted);
-
- if (r < 0)
+ if (asprintf(&name, "%s@%u.service", prefix, s->n_accepted) < 0)
return -ENOMEM;
r = manager_load_unit(UNIT(s)->manager, name, NULL, NULL, &u);
-
if (r < 0)
return r;