qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] aspeed: Fix a potential memory leak bug in write_boot_rom()


From: Peter Maydell
Subject: Re: [PATCH] aspeed: Fix a potential memory leak bug in write_boot_rom()
Date: Wed, 2 Mar 2022 12:29:46 +0000

On Wed, 2 Mar 2022 at 08:33, Cédric Le Goater <clg@kaod.org> wrote:
>
> From: Wentao_Liang <Wentao_Liang_g@163.com>
>
> A memory chunk is allocated with g_new0() and assigned to the variable
> 'storage'. However, if the branch takes true, there will be only an
> error report but not a free operation for 'storage' before function
> returns. As a result, a memory leak bug is triggered.
>
> Use g_autofree to fix the issue.
>
> Suggested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Signed-off-by: Wentao_Liang <Wentao_Liang_g@163.com>
> [ clg: reworked the commit log ]
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]