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>
This commit is contained in:
Amit Shah
2011-07-27 20:19:27 +03:00
committed by Michael S. Tsirkin
parent b52dfd71f3
commit 845f85fa15
+1
View File
@@ -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)