Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
akihikodaki authored and pm215 committed Aug 22, 2023
1 parent bc3e41a commit 4625742
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions accel/kvm/kvm-all.c
Expand Up @@ -2765,6 +2765,7 @@ static int kvm_init(MachineState *ms)
if (s->fd != -1) {
close(s->fd);
}
g_free(s->as);
g_free(s->memory_listener.slots);

return ret;
Expand Down

0 comments on commit 4625742

Please sign in to comment.