From: Alan T. DeKok Date: Mon, 14 Nov 2022 20:23:09 +0000 (-0500) Subject: close sockfd on error. Fixes CID #1516897 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a023329205f81929914fa9d50cd83bbbe010bad;p=thirdparty%2Ffreeradius-server.git close sockfd on error. Fixes CID #1516897 --- diff --git a/src/listen/control/proto_control_unix.c b/src/listen/control/proto_control_unix.c index 6f520fbd6d4..b5cc339edae 100644 --- a/src/listen/control/proto_control_unix.c +++ b/src/listen/control/proto_control_unix.c @@ -419,6 +419,7 @@ static int fr_server_domain_socket_peercred(char const *path, uid_t UNUSED uid, * functions to avoid time of check/time of use insecurities. */ if (fr_dirfd(&dirfd, &r, path) < 0) { + close(sockfd); fr_strerror_printf("Failed to open directory containing %s", path); return -1; }