From 848e64e0e4bbfa5fc2b9d7cb4a88a88ca9caf894 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..97a7878 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; }