aboutsummaryrefslogtreecommitdiff
path: root/tcg/optimize.c
diff options
context:
space:
mode:
authorWentao_Liang <Wentao_Liang_g@163.com>2022-03-08 09:18:11 +0100
committerCédric Le Goater <clg@kaod.org>2022-03-08 09:18:11 +0100
commit05e6e40a869cc7e4492c5ffc8161005bbb7be986 (patch)
tree129f4ba474e6f31f0c72f5a22db6fc95a2b923fc /tcg/optimize.c
parentb49872aa8fc0f3f5a3036cc37aa2cb5c92866f33 (diff)
downloadqemu-05e6e40a869cc7e4492c5ffc8161005bbb7be986.zip
qemu-05e6e40a869cc7e4492c5ffc8161005bbb7be986.tar.gz
qemu-05e6e40a869cc7e4492c5ffc8161005bbb7be986.tar.bz2
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>
Diffstat (limited to 'tcg/optimize.c')
0 files changed, 0 insertions, 0 deletions