Skip to content

Commit dfcdda5

Browse files
committed
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 <[email protected]>
1 parent 39263fa commit dfcdda5

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)