Skip to content

Commit d531e4b

Browse files
committed
Fix memory leak reported by static analyzer tool
This memory leak, although not easily reproducible, has been detected by Static Application Security Testing tool (clang). This fix eliminates it. Signed-off-by: Sergio Arroutbi <[email protected]>
1 parent 0210575 commit d531e4b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/socket.c

+3
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ int run_service(const char *jwkdir, int port, process_request_func pfunc)
201201
r = listen_port(&slist, port);
202202
if (r < 0) {
203203
fprintf(stderr, "Could not listen port (%d)\n", port);
204+
if(slist) {
205+
free_socket_list(slist);
206+
}
204207
return -1;
205208
}
206209

0 commit comments

Comments
 (0)