From: Greg Kurz <groug@kaod.org>
To: Jiajun Chen <chenjiajun8@huawei.com>
Cc: Christian Schoenebeck <qemu_oss@crudebyte.com>,
qemu-devel@nongnu.org, xiexiangyou@huawei.com
Subject: Re: [PATCH] 9pfs: local: Fix possible memory leak in local_link()
Date: Mon, 23 Dec 2019 11:59:09 +0100 [thread overview]
Message-ID: <20191223115909.524ca244@bahia.lan> (raw)
In-Reply-To: <20191220094934.21232-1-chenjiajun8@huawei.com>
On Fri, 20 Dec 2019 17:49:34 +0800
Jiajun Chen <chenjiajun8@huawei.com> wrote:
> 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>
> ---
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);
next prev parent reply other threads:[~2019-12-23 11:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2020-01-06 11:07 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191223115909.524ca244@bahia.lan \
--to=groug@kaod.org \
--cc=chenjiajun8@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu_oss@crudebyte.com \
--cc=xiexiangyou@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).