|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [PATCH] 9pfs: local: Fix possible memory leak in local_link() |
Date: | Mon, 6 Jan 2020 12:07:01 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 |
On 12/23/19 11:59 AM, Greg Kurz wrote:
On Fri, 20 Dec 2019 17:49:34 +0800 Jiajun Chen <address@hidden> wrote: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> ---Applied to 9p-next.
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Thanks.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);
[Prev in Thread] | Current Thread | [Next in Thread] |