Skip to content

Commit

Permalink
Fix memory leak reported by clang tool (#149)
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 authored Jan 24, 2025
1 parent 83de399 commit 8b50496
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 8b50496

Please sign in to comment.