From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlzWT-0006tH-1t for qemu-devel@nongnu.org; Wed, 27 Jul 2011 04:31:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlzWR-0005XO-S4 for qemu-devel@nongnu.org; Wed, 27 Jul 2011 04:31:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlzWR-0005XE-KP for qemu-devel@nongnu.org; Wed, 27 Jul 2011 04:31:19 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6R8VIku031023 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 27 Jul 2011 04:31:19 -0400 From: Amit Shah Date: Wed, 27 Jul 2011 14:00:32 +0530 Message-Id: <0139341db2e3b0402f2396b78daf535fe182044e.1311755243.git.amit.shah@redhat.com> In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [PATCH 4/4] virtio: Plug memleak by freeing vdev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu list Cc: Kevin Wolf , Amit Shah , Markus Armbruster , "Michael S. Tsirkin" 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 --- hw/virtio.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) 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) -- 1.7.6