trace-cmd-listen: Fix resource leak of msg_handle
PATCH 1/1 trace-cmd-listen: Fix resource leak of msg_handle
Fix the potential resource leak of msg_handle by calling tracecmd_msg_handle_close before returning in an error path
Signed-off-by John Kacur <[email protected]>
--- tracecmd/trace-listen.c | 1 + 1 file changed, 1 insertion(+)
tracecmd/trace-listen.c +1 -0
@@ -761,6 +761,7 @@ static int do_connection(int cfd, struct sockaddr_storage *peer_addr,plog ("Error with getnameinfo: %s\n" ,gai_strerror (s));close (cfd); +tracecmd_msg_handle_close (msg_handle);return -1 ; }
Signature · 1 line
2.20.1
Steven Rostedt
AppliedQuoted 13 lines · On Fri, 3 May 2019 16:24:49 +0200 John Kacur <[email protected]> wrote:
Fix the potential resource leak of
msg_handleby callingtracecmd_msg_handle_closebefore returning in an error pathSigned-off-by John Kacur <[email protected]>--- tracecmd/trace-listen.c | 1 + 1 file changed, 1 insertion(+)tracecmd/trace-listen.c +0
-0
tracecmd/trace-listen.c static int do_connection(int cfd, struct sockaddr_storage *peer_addr, · line 767
Quoted 7 lines
tracecmd/trace-listen.c +1
-0@@ -761,6 +761,7 @@ static int do_connection(int cfd, struct sockaddr_storage *peer_addr,plog ("Error with getnameinfo: %s\n" ,gai_strerror (s));close (cfd); +tracecmd_msg_handle_close (msg_handle);return -1 ; }
Applied. Thanks John!
-- Steve