qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-9p: Fix a memory leak
@ 2011-05-06 19:05 Pedro Scarapicchia Junior
  2011-05-07  8:34 ` Stefan Hajnoczi
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Scarapicchia Junior @ 2011-05-06 19:05 UTC (permalink / raw)
  To: qemu-devel; +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 <pedro.scarapiccha@br.flextronics.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-05-08 17:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-06 19:05 [Qemu-devel] [PATCH] virtio-9p: Fix a memory leak Pedro Scarapicchia Junior
2011-05-07  8:34 ` Stefan Hajnoczi
2011-05-07  8:56   ` Stefan Weil
2011-05-07 20:27     ` Pedro Scarapicchia Junior
2011-05-08 17:40       ` Venkateswararao Jujjuri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).