From 5cf1c61152bfd5f1eef7f49509a877090f4cc26f Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabelac@redhat.com>
Date: Tue, 25 Jun 2019 15:11:05 +0200
Subject: [PATCH] cov: check for socket_path being set

As we check for existince on entering path
let's ensure it's there also on exit path.
---
 libdaemon/server/daemon-server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index 79b54d0..bc58f7b 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -693,7 +693,7 @@ void daemon_start(daemon_state s)
 out:
 	/* If activated by systemd, do not unlink the socket - systemd takes care of that! */
 	if (!_systemd_activation && s.socket_fd >= 0)
-		if (unlink(s.socket_path))
+		if (s.socket_path && unlink(s.socket_path))
 			perror("unlink error");
 
 	if (s.socket_fd >= 0)
-- 
1.8.3.1

