]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Don't leak client_fd on error
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 11 Sep 2015 16:18:58 +0000 (17:18 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 11 Sep 2015 16:19:49 +0000 (17:19 +0100)
src/main/command.c

index d7e7a5e4373fe7705f4c834557ab3e22d1ff0ec1..f2b54ccd3826b85acafac7bcea6c037268b4b534 100644 (file)
@@ -223,6 +223,7 @@ static int fr_server_domain_socket_peercred(char const *path, uid_t UNUSED uid,
                client_fd = fr_socket_client_unix(path, false);
                if (client_fd >= 0) {
                        fr_strerror_printf("Control socket '%s' is already in use", path);
+                       close(client_fd);
                        close(sockfd);
                        return -1;
                }