Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aspeed: Fix a potential memory leak bug in write_boot_rom()
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> Reviewed-by: Peter Maydell <peter.maydell@linaro.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>
- Loading branch information