From: Anthony Liguori <aliguori@us.ibm.com>
To: Jesse Larrew <jlarrew@linux.vnet.ibm.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] libqtest: only call fclose() on open files
Date: Tue, 30 Apr 2013 09:51:08 -0500 [thread overview]
Message-ID: <87ppxcnkbn.fsf@codemonkey.ws> (raw)
In-Reply-To: <1367250772-17928-1-git-send-email-jlarrew@linux.vnet.ibm.com>
Jesse Larrew <jlarrew@linux.vnet.ibm.com> writes:
> libqtest.c can segfault when calling fclose() if the pidfile wasn't
> opened successfully. This patch fixes the issue.
>
> Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Regards,
Anthony Liguori
> ---
> tests/libqtest.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/libqtest.c b/tests/libqtest.c
> index 884f959..879ffe9 100644
> --- a/tests/libqtest.c
> +++ b/tests/libqtest.c
> @@ -99,8 +99,8 @@ static pid_t qtest_qemu_pid(QTestState *s)
> if (fgets(buffer, sizeof(buffer), f)) {
> pid = atoi(buffer);
> }
> + fclose(f);
> }
> - fclose(f);
> return pid;
> }
>
> --
> 1.7.11.7
next prev parent reply other threads:[~2013-04-30 14:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-29 15:52 [Qemu-devel] [PATCH] libqtest: only call fclose() on open files Jesse Larrew
2013-04-30 14:51 ` Anthony Liguori [this message]
2013-05-02 15:55 ` Anthony Liguori
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=87ppxcnkbn.fsf@codemonkey.ws \
--to=aliguori@us.ibm.com \
--cc=jlarrew@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).