From: Li Qiang <liqiang...@360.cn> 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 <liqiang...@360.cn> Reviewed-by: Greg Kurz <gr...@kaod.org> [groug, rephrased the changelog] Signed-off-by: Greg Kurz <gr...@kaod.org> --- 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