linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: John Kacur <jkacur@redhat.com>
Cc: linux-trace-devel@vger.kernel.org, Clark Williams <williams@redhat.com>
Subject: Re: [PATCH] trace-cmd-listen: Fix resource leak of msg_handle
Date: Fri, 3 May 2019 12:17:08 -0400	[thread overview]
Message-ID: <20190503121708.711bef39@gandalf.local.home> (raw)
In-Reply-To: <20190503142449.9936-1-jkacur@redhat.com>

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

      reply	other threads:[~2019-05-03 16:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-03 14:24 [PATCH] trace-cmd-listen: Fix resource leak of msg_handle John Kacur
2019-05-03 16:17 ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190503121708.711bef39@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=jkacur@redhat.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).