Skip to content

Commit

Permalink
Fix memory leak reported by clang tool
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sarroutbi committed Nov 11, 2024
1 parent 0210575 commit 848e64e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 848e64e

Please sign in to comment.