[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] 9pfs: local: Fix possible memory leak in local_link()
From: |
Greg Kurz |
Subject: |
Re: [PATCH] 9pfs: local: Fix possible memory leak in local_link() |
Date: |
Mon, 23 Dec 2019 11:59:09 +0100 |
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.
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);