aboutsummaryrefslogtreecommitdiff
path: root/accel
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2023-08-22 17:31:04 +0100
committerPeter Maydell <peter.maydell@linaro.org>2023-08-22 17:31:04 +0100
commit4625742cd2aeb1400407889a2f7a5b4c75437818 (patch)
tree982314f79967682604f0673e8408654c9f43439f /accel
parentbc3e41a0e8a3c932733dd363dfcfb38bf167b707 (diff)
accel/kvm: Free as when an error occurred
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>
Diffstat (limited to 'accel')
-rw-r--r--accel/kvm/kvm-all.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 3bac5aa678..ed30f4135b 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;