qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Robert Foley <robert.foley@linaro.org>
Cc: peter.puhov@linaro.org, qemu-devel@nongnu.org
Subject: Re: [PATCH v1 5/5] Fix double free issue in qemu_set_log_filename().
Date: Tue, 12 Nov 2019 18:23:02 +0000	[thread overview]
Message-ID: <87ftit7y49.fsf@linaro.org> (raw)
In-Reply-To: <20191112150105.2498-6-robert.foley@linaro.org>


Robert Foley <robert.foley@linaro.org> writes:

> After freeing the logfilename, we set logfilename to NULL, in case of an
> error which returns without setting logfilename.
>
> Signed-off-by: Robert Foley <robert.foley@linaro.org>

As this fixes an existing bug I would put this at the start of the
series. Otherwise:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
> v1
>     - This is new in the patch v1.
> ---
>  util/log.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/util/log.c b/util/log.c
> index 802b8de42e..1eed74788c 100644
> --- a/util/log.c
> +++ b/util/log.c
> @@ -148,6 +148,7 @@ void qemu_set_log_filename(const char *filename, Error **errp)
>      char *pidstr;
>
>      g_free(logfilename);
> +    logfilename = NULL;
>
>      pidstr = strstr(filename, "%");
>      if (pidstr) {


--
Alex Bennée


      reply	other threads:[~2019-11-12 18:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12 15:01 [PATCH v1 0/5] Make the qemu_logfile handle thread safe Robert Foley
2019-11-12 15:01 ` [PATCH v1 1/5] Add a mutex to guarantee single writer to qemu_logfile handle Robert Foley
2019-11-12 17:09   ` Alex Bennée
2019-11-16 11:57   ` Richard Henderson
2019-11-18 12:39     ` Robert Foley
2019-11-12 15:01 ` [PATCH v1 2/5] qemu_log_lock/unlock now preserves the " Robert Foley
2019-11-12 17:17   ` Alex Bennée
2019-11-16 12:26   ` Richard Henderson
2019-11-12 15:01 ` [PATCH v1 3/5] Add use of RCU for qemu_logfile Robert Foley
2019-11-12 17:36   ` Alex Bennée
2019-11-12 19:20     ` Robert Foley
2019-11-13 15:24       ` Alex Bennée
2019-11-12 15:01 ` [PATCH v1 4/5] Added tests for close and change of logfile Robert Foley
2019-11-12 18:21   ` Alex Bennée
2019-11-12 15:01 ` [PATCH v1 5/5] Fix double free issue in qemu_set_log_filename() Robert Foley
2019-11-12 18:23   ` Alex Bennée [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=87ftit7y49.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=peter.puhov@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=robert.foley@linaro.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).