From: Amit Shah Date: Wed, 27 Jul 2011 08:30:32 +0000 (+0530) Subject: virtio: Plug memleak by freeing vdev X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~5593^2~7^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=845f85fa1597c72609bd10a37b9586b445c13d49;p=sdk%2Femulator%2Fqemu.git 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 Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/virtio.c b/hw/virtio.c index a8f4940..93dfb1e 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)