[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [PATCH 3/4] hw/ppc/e500.c: Fix memory leak
From: |
Michael Tokarev |
Subject: |
Re: [Qemu-trivial] [PATCH 3/4] hw/ppc/e500.c: Fix memory leak |
Date: |
Thu, 28 May 2015 14:57:55 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 |
28.05.2015 14:13, Shannon Zhao wrote:
> From: Shannon Zhao <address@hidden>
>
> Signed-off-by: Shannon Zhao <address@hidden>
> Signed-off-by: Shannon Zhao <address@hidden>
> ---
> hw/ppc/e500.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index c10e1b5..f74e6f2 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -1027,9 +1027,11 @@ void ppce500_init(MachineState *machine, PPCE500Params
> *params)
> NULL, NULL);
> if (kernel_size < 0) {
> fprintf(stderr, "qemu: could not load firmware '%s'\n",
> filename);
> + g_free(filename);
> exit(1);
> }
> }
> + g_free(filename);
Hm. This is probably the patch I was thinking about when saying
you _removed" g_free() before exit(), but you're _adding_ oneā¦ ;)
My bad.
Anyway, I don't think there's any reason to add such free() before
exiting. Second g_free() is okay, first is unnecessary. I think.
Thanks,
/mjt