]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/misc/applesmc: Fix memory leak in reset() handler
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 8 Apr 2024 09:41:59 +0000 (11:41 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 10 Apr 2024 16:38:01 +0000 (19:38 +0300)
commit9b7bc39890b6bea852db9e1427648e28f61e751b
treeb002b9de3e8fad9e5ecb10e86517f4a729be42d9
parent8394be7faa2d200046a902bdec9cdb1d6fdb3ae0
hw/misc/applesmc: Fix memory leak in reset() handler

AppleSMCData is allocated with g_new0() in applesmc_add_key():
release it with g_free().

Leaked since commit 1ddda5cd36 ("AppleSMC device emulation").

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2272
Reported-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20240408095217.57239-3-philmd@linaro.org>
(cherry picked from commit fc09ff2979defdcf8d00c2db94022d5d610e36ba)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/misc/applesmc.c