From 2a73be0eec87fc637a080e200f9a95de75676b9a Mon Sep 17 00:00:00 2001 From: Sergio Arroutbi Date: Thu, 16 May 2024 16:15:01 +0200 Subject: [PATCH] Fix memory leak reported by clang tool This memory leak, although not easily reproducible, has been detected by Static Application Security Testing tool (trhough clang compiler). This fix eliminates it. Signed-off-by: Sergio Arroutbi --- src/socket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/socket.c b/src/socket.c index df512cc..69c9b34 100644 --- a/src/socket.c +++ b/src/socket.c @@ -201,6 +201,9 @@ int run_service(const char *jwkdir, int port, process_request_func pfunc) r = listen_port(&slist, port); if (r < 0) { fprintf(stderr, "Could not listen port (%d)\n", port); + if (slist) { + free_socket_list(slist); + } return -1; }