提交 18f6b13e 编写于 作者: J Jiajun Chen 提交者: Michael Roth

9pfs: local: Fix possible memory leak in local_link()

There is a possible memory leak while local_link return -1 without free
odirpath and oname.
Reported-by: NEuler Robot <euler.robot@huawei.com>
Signed-off-by: NJaijun Chen <chenjiajun8@huawei.com>
Signed-off-by: NXiang Zheng <zhengxiang9@huawei.com>
Reviewed-by: NChristian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: NGreg Kurz <groug@kaod.org>
(cherry picked from commit 841b8d09)
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 6c75ddf4
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册