From patchwork Wed Jul 27 08:30:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 106995 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 99C0AB6F00 for ; Wed, 27 Jul 2011 18:32:06 +1000 (EST) Received: from localhost ([::1]:60423 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlzX9-0000kW-If for incoming@patchwork.ozlabs.org; Wed, 27 Jul 2011 04:32:03 -0400 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 Received: from localhost (ovpn-113-54.phx2.redhat.com [10.3.113.54]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6R8VFtK011004; Wed, 27 Jul 2011 04:31:17 -0400 From: Amit Shah To: qemu list 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: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Amit Shah , Markus Armbruster , "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH 4/4] virtio: Plug memleak by freeing vdev X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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)