Received: from eggs.gnu.org ([140.186.70.92]:58618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIQLc-00016l-Hj for qemu-devel@nongnu.org; Fri, 06 May 2011 15:05:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QIQLb-0003Jt-EO for qemu-devel@nongnu.org; Fri, 06 May 2011 15:05:56 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:52272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIQLb-0003Jh-Bq for qemu-devel@nongnu.org; Fri, 06 May 2011 15:05:55 -0400 Received: by ywl41 with SMTP id 41so1533731ywl.4 for ; Fri, 06 May 2011 12:05:54 -0700 (PDT) From: Pedro Scarapicchia Junior Date: Fri, 6 May 2011 16:05:47 -0300 Message-Id: <1304708747-3692-1-git-send-email-pedro.scarapiccha@br.flextronics.com> Subject: [Qemu-devel] [PATCH] virtio-9p: Fix a memory leak List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Pedro Scarapicchia Junior At v9fs_walk_complete(), the memory allocated at v9fs_walk() is not being released leading system to crash due out of memory. This patch releases structure V9fsWalkState after v9fs_walk is complete. Signed-off-by: Pedro Scarapicchia Junior --- hw/9pfs/virtio-9p.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c index b5fc52b..b1da2b7 100644 --- a/hw/9pfs/virtio-9p.c +++ b/hw/9pfs/virtio-9p.c @@ -1490,6 +1490,8 @@ static void v9fs_walk_complete(V9fsState *s, V9fsWalkState *vs, int err) qemu_free(vs->wnames); qemu_free(vs->qids); } + + qemu_free(vs); } static void v9fs_walk_marshal(V9fsWalkState *vs) -- 1.7.1