From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, Michael Tokarev <mjt@tls.msk.ru>
Subject: Re: [Qemu-devel] [PATCH] gdbstub: Prevent fd leakage
Date: Fri, 25 May 2018 05:37:12 +0200 [thread overview]
Message-ID: <7163a9ba-3640-68e8-4b4e-ff57189de65e@redhat.com> (raw)
In-Reply-To: <20180524223458.5651-1-f4bug@amsat.org>
On 25.05.2018 00:34, Philippe Mathieu-Daudé wrote:
> Since 2f652224f7, we now check if socket_set_nodelay() errored,
> but forgot to close the socket before reporting an error.
>
> Fixes: Coverity CID 1391290 (RESOURCE_LEAK)
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> gdbstub.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/gdbstub.c b/gdbstub.c
> index e4ece2f5bc..9c860cd81c 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -1836,6 +1836,7 @@ static bool gdb_accept(void)
> /* set short latency */
> if (socket_set_nodelay(fd)) {
> perror("setsockopt");
> + close(fd);
> return false;
> }
Reviewed-by: Thomas Huth <thuth@redhat.com>
next prev parent reply other threads:[~2018-05-25 3:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-24 22:34 [Qemu-devel] [PATCH] gdbstub: Prevent fd leakage Philippe Mathieu-Daudé
2018-05-25 3:37 ` Thomas Huth [this message]
2018-05-25 13:52 ` Peter Maydell
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=7163a9ba-3640-68e8-4b4e-ff57189de65e@redhat.com \
--to=thuth@redhat.com \
--cc=f4bug@amsat.org \
--cc=mjt@tls.msk.ru \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).