[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 1/5] 9pfs: local: Fix possible memory leak in local_link()
From: |
Greg Kurz |
Subject: |
[PULL 1/5] 9pfs: local: Fix possible memory leak in local_link() |
Date: |
Tue, 14 Jan 2020 17:02:31 +0100 |
From: Jiajun Chen <address@hidden>
There is a possible memory leak while local_link return -1 without free
odirpath and oname.
Reported-by: Euler Robot <address@hidden>
Signed-off-by: Jaijun Chen <address@hidden>
Signed-off-by: Xiang Zheng <address@hidden>
Reviewed-by: Christian Schoenebeck <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>
---
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 ca641390fbca..d0592c3b4504 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.1
- [PULL 0/5] 9p patches 2020-01-14, Greg Kurz, 2020/01/14
- [PULL 2/5] 9p: local: always return -1 on error in local_unlinkat_common, Greg Kurz, 2020/01/14
- [PULL 1/5] 9pfs: local: Fix possible memory leak in local_link(),
Greg Kurz <=
- [PULL 3/5] 9p: init_in_iov_from_pdu can truncate the size, Greg Kurz, 2020/01/14
- [PULL 4/5] virtfs-proxy-helper.c: remove 'err_out' label in setugid(), Greg Kurz, 2020/01/14
- [PULL 5/5] 9pfs/9p.c: remove unneeded labels, Greg Kurz, 2020/01/14
- Re: [PULL 0/5] 9p patches 2020-01-14, Peter Maydell, 2020/01/17