hw/misc/applesmc: Fix memory leak in reset() handler
commitfc09ff2979defdcf8d00c2db94022d5d610e36ba
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 8 Apr 2024 09:41:59 +0000 (8 11:41 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 10 Apr 2024 07:09:34 +0000 (10 09:09 +0200)
tree8f5e00d33e74f1fa04c24b13db2f30a4c1db8026
parent5c338216f57a433d897f30b258063ea75319b597
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>
hw/misc/applesmc.c