From: Li Qiang Date: Mon, 17 Oct 2016 12:13:58 +0000 (+0200) Subject: 9pfs: fix memory leak in v9fs_link X-Git-Tag: TizenStudio_2.0_p2.3.2~9^2~14^2~5^2~125^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c1586787ff43c9acd18a56c12d720e3e6be9f7c;p=sdk%2Femulator%2Fqemu.git 9pfs: fix memory leak in v9fs_link 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 Reviewed-by: Greg Kurz [groug, rephrased the changelog] Signed-off-by: Greg Kurz --- diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 66135cf..d43a552 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: