ctl_handler_init: fixed resource leaks

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
This commit is contained in:
Nikos Mavrogiannopoulos
2021-04-01 17:09:25 +02:00
parent 6677ac04fa
commit 2d1bd947e2

View File

@@ -147,6 +147,7 @@ int ctl_handler_init(main_server_st * s)
e = errno;
mslog(s, NULL, LOG_ERR, "could not bind socket '%s': %s",
GETPCONFIG(s)->occtl_socket_file, strerror(e));
close(sd);
return -1;
}
@@ -162,6 +163,7 @@ int ctl_handler_init(main_server_st * s)
e = errno;
mslog(s, NULL, LOG_ERR, "could not listen to socket '%s': %s",
GETPCONFIG(s)->occtl_socket_file, strerror(e));
close(sd);
return -1;
}