Message ID | 20190503142449.9936-1-jkacur@redhat.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 50b0d604e5fdb414eb0dd155a196c50473e13fc1 |
Headers | show |
Series | trace-cmd-listen: Fix resource leak of msg_handle | expand |
On Fri, 3 May 2019 16:24:49 +0200 John Kacur <jkacur@redhat.com> wrote: > 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 <jkacur@redhat.com> > --- > tracecmd/trace-listen.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tracecmd/trace-listen.c b/tracecmd/trace-listen.c > index 8bd7badb50e1..3106022eeb39 100644 > --- a/tracecmd/trace-listen.c > +++ b/tracecmd/trace-listen.c > @@ -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
diff --git a/tracecmd/trace-listen.c b/tracecmd/trace-listen.c index 8bd7badb50e1..3106022eeb39 100644 --- a/tracecmd/trace-listen.c +++ b/tracecmd/trace-listen.c @@ -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; }
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 <jkacur@redhat.com> --- tracecmd/trace-listen.c | 1 + 1 file changed, 1 insertion(+)