qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 11/12] 9pfs: fix memory leak in v9fs_link


From: Greg Kurz
Subject: [Qemu-devel] [PULL 11/12] 9pfs: fix memory leak in v9fs_link
Date: Mon, 17 Oct 2016 17:05:53 +0200

From: Li Qiang <address@hidden>

The v9fs_link() function keeps a reference on the source fid object. This
causes a memory leak since the reference never goes down to 0. This patch
fixes the issue.

Signed-off-by: Li Qiang <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
[groug, rephrased the changelog]
Signed-off-by: Greg Kurz <address@hidden>
---
 hw/9pfs/9p.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 66135cf12183..d43a55223492 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -2413,6 +2413,7 @@ static void coroutine_fn v9fs_link(void *opaque)
     if (!err) {
         err = offset;
     }
+    put_fid(pdu, oldfidp);
 out:
     put_fid(pdu, dfidp);
 out_nofid:
-- 
2.5.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]