]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/loongarch/virt: Fix memory leak
authorSong Gao <gaosong@loongson.cn>
Tue, 7 May 2024 02:22:39 +0000 (10:22 +0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 10 May 2024 08:21:18 +0000 (11:21 +0300)
commitd92179b57ebfe620ce8a9db76dc10ccbdb93d0eb
treee4e3856dd508118b66a132b6c9f8a0e45f86c98e
parentf6d315ffdf36fe768e5f1eaf44cd7a636285da1c
hw/loongarch/virt: Fix memory leak

The char pointer 'ramName' point to a block of memory,
but never free it. Use 'g_autofree' to automatically free it.

Resolves: Coverity CID 1544773

Fixes: 0cf1478d6 ("hw/loongarch: Add numa support")
Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240507022239.3113987-1-gaosong@loongson.cn>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
(cherry picked from commit 54c52ec719fb8c83bbde54cb87b58688ab27c166)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(Mjt: context fixup in hw/loongarch/virt.c due to missing-in-9.0
      v9.0.0-266-gd771ca1c10 "hw/loongarch: Move boot functions to boot.c")
hw/loongarch/virt.c