[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.11 52/59] hw/misc/applesmc: Fix memory leak in reset() handl
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.11 52/59] hw/misc/applesmc: Fix memory leak in reset() handler |
Date: |
Thu, 18 Apr 2024 23:02:12 +0300 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
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>
diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c
index 5f9c742e50..80642efc57 100644
--- a/hw/misc/applesmc.c
+++ b/hw/misc/applesmc.c
@@ -273,6 +273,7 @@ static void qdev_applesmc_isa_reset(DeviceState *dev)
/* Remove existing entries */
QLIST_FOREACH_SAFE(d, &s->data_def, node, next) {
QLIST_REMOVE(d, node);
+ g_free(d);
}
s->status = 0x00;
s->status_1e = 0x00;
--
2.39.2
- [Stable-7.2.11 v2 00/59] Patch Round-up for stable 7.2.11, freeze on 2024-04-20, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 42/59] tcg/optimize: Do not attempt to constant fold neg_vec, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 43/59] linux-user: Fix waitid return of siginfo_t and rusage, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 46/59] hw/char/virtio-serial-bus: Protect from DMA re-entrancy bugs, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 45/59] hw/display/virtio-gpu: Protect from DMA re-entrancy bugs, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 48/59] qemu-options: Fix CXL Fixed Memory Window interleave-granularity typo, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 52/59] hw/misc/applesmc: Fix memory leak in reset() handler,
Michael Tokarev <=
- [Stable-7.2.11 50/59] hw/block/nand: Have blk_load() take unsigned offset and return boolean, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 44/59] hw/virtio: Introduce virtio_bh_new_guarded() helper, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 51/59] hw/block/nand: Fix out-of-bound access in NAND block buffer, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 47/59] hw/virtio/virtio-crypto: Protect from DMA re-entrancy bugs, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 53/59] backends/cryptodev: Do not abort for invalid session ID, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 49/59] hw/block/nand: Factor nand_load_iolen() method out, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 54/59] hw/net/lan9118: Fix overflow in MIL TX FIFO, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 56/59] hw/sd/sdhci: Do not update TRNMOD when Command Inhibit (DAT) is set, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 55/59] hw/net/lan9118: Replace magic '2048' value by MIL_TXFIFO_SIZE definition, Michael Tokarev, 2024/04/18
- [Stable-7.2.11 57/59] target/sh4: add missing CHECK_NOT_DELAY_SLOT, Michael Tokarev, 2024/04/18