diff mbox series

[PULL,11/35] accel/kvm: Free as when an error occurred

Message ID 20230824092836.2239644-12-peter.maydell@linaro.org
State Not Applicable
Headers show
Series [PULL,01/35] hw/gpio/nrf51: implement DETECT signal | expand

Commit Message

Peter Maydell Aug. 24, 2023, 9:28 a.m. UTC
From: Akihiko Odaki <akihiko.odaki@daynix.com>

An error may occur after s->as is allocated, for example if the
KVM_CREATE_VM ioctl call fails.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-id: 20230727073134.134102-6-akihiko.odaki@daynix.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: tweaked commit message]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 accel/kvm/kvm-all.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 3bac5aa678b..ed30f4135b5 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2765,6 +2765,7 @@  err:
     if (s->fd != -1) {
         close(s->fd);
     }
+    g_free(s->as);
     g_free(s->memory_listener.slots);
 
     return ret;