aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio.c
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2011-07-27 14:00:32 +0530
committerMichael S. Tsirkin <mst@redhat.com>2011-07-27 20:19:27 +0300
commit845f85fa1597c72609bd10a37b9586b445c13d49 (patch)
tree07f02316413edb06bb2e5b95c4507a492acbdaaa /hw/virtio.c
parentb52dfd71f33b902e612b12f6cc89f3b61e4d3e22 (diff)
virtio: Plug memleak by freeing vdev
virtio_common_init() allocates RAM for the vdev struct (and any additional memory, depending on the size passed to the function). This memory wasn't being freed until now. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio.c')
-rw-r--r--hw/virtio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/virtio.c b/hw/virtio.c
index a8f4940da2..93dfb1e359 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -834,6 +834,7 @@ void virtio_cleanup(VirtIODevice *vdev)
if (vdev->config)
qemu_free(vdev->config);
qemu_free(vdev->vq);
+ qemu_free(vdev);
}
static void virtio_vmstate_change(void *opaque, int running, int reason)