qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 9pfs: local: Fix possible memory leak in local_link()
@ 2019-12-20  9:49 Jiajun Chen
  2019-12-20 14:42 ` Christian Schoenebeck
  2019-12-23 10:59 ` Greg Kurz
  0 siblings, 2 replies; 4+ messages in thread
From: Jiajun Chen @ 2019-12-20  9:49 UTC (permalink / raw)
  To: groug; +Cc: qemu-devel, xiexiangyou

There is a possible memory leak while local_link return -1 without free
odirpath and oname.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Jaijun Chen <chenjiajun8@huawei.com>
Signed-off-by: Xiang Zheng <zhengxiang9@huawei.com>
---
 hw/9pfs/9p-local.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c
index 4708c0bd89..491b08aee8 100644
--- a/hw/9pfs/9p-local.c
+++ b/hw/9pfs/9p-local.c
@@ -947,7 +947,7 @@ static int local_link(FsContext *ctx, V9fsPath *oldpath,
     if (ctx->export_flags & V9FS_SM_MAPPED_FILE &&
         local_is_mapped_file_metadata(ctx, name)) {
         errno = EINVAL;
-        return -1;
+        goto out;
     }
 
     odirfd = local_opendir_nofollow(ctx, odirpath);
-- 
2.21.0.windows.1




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

end of thread, other threads:[~2020-01-06 11:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-20  9:49 [PATCH] 9pfs: local: Fix possible memory leak in local_link() Jiajun Chen
2019-12-20 14:42 ` Christian Schoenebeck
2019-12-23 10:59 ` Greg Kurz
2020-01-06 11:07   ` Philippe Mathieu-Daudé

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).