summaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-01-21 02:49:12 +0100
committerLennart Poettering <lennart@poettering.net>2011-01-21 02:49:12 +0100
commitcae18e217208735797232eabb83a93470aefe88f (patch)
treee51e7d8454db6ff1aac9316ec0a53705399f61d9 /src/socket.c
parent036315352d48c1563ef53b7c0ff58c20e9a2dc8d (diff)
socket: don't crash if the .service unit for a .socket unit is not found
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/socket.c b/src/socket.c
index 3bb8862ca9..4443dba0c9 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -760,8 +760,9 @@ static int socket_open_fds(Socket *s) {
if ((r = socket_instantiate_service(s)) < 0)
return r;
- if ((r = label_get_socket_label_from_exe(s->service->exec_command[SERVICE_EXEC_START]->path, &label)) < 0)
- return r;
+ if (s->service && s->service->exec_command[SERVICE_EXEC_START])
+ if ((r = label_get_socket_label_from_exe(s->service->exec_command[SERVICE_EXEC_START]->path, &label)) < 0)
+ return r;
know_label = true;
}