[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 5/5] Fix double free issue in qemu_set_log_filename().
From: |
Alex Bennée |
Subject: |
Re: [PATCH v1 5/5] Fix double free issue in qemu_set_log_filename(). |
Date: |
Tue, 12 Nov 2019 18:23:02 +0000 |
User-agent: |
mu4e 1.3.5; emacs 27.0.50 |
Robert Foley <address@hidden> 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 <address@hidden>
As this fixes an existing bug I would put this at the start of the
series. Otherwise:
Reviewed-by: Alex Bennée <address@hidden>
> ---
> 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