From 2d1bd947e29221e1af5a37f703a948c9eeaed815 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Thu, 1 Apr 2021 17:09:25 +0200 Subject: [PATCH] ctl_handler_init: fixed resource leaks Signed-off-by: Nikos Mavrogiannopoulos --- src/main-ctl-unix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main-ctl-unix.c b/src/main-ctl-unix.c index b80bf6bd..d840ef8b 100644 --- a/src/main-ctl-unix.c +++ b/src/main-ctl-unix.c @@ -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; }