qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Greg Kurz <groug@kaod.org>, Li Qiang <liq3ea@gmail.com>,
	Li Qiang <liqiang6-s@360.cn>
Subject: [Qemu-devel] [PULL] 9pfs: xattr: fix memory leak in v9fs_list_xattr
Date: Mon, 10 Apr 2017 16:21:35 +0200	[thread overview]
Message-ID: <1491834095-6476-2-git-send-email-groug@kaod.org> (raw)
In-Reply-To: <1491834095-6476-1-git-send-email-groug@kaod.org>

From: Li Qiang <liq3ea@gmail.com>

Free 'orig_value' in error path.

Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Signed-off-by: Greg Kurz <groug@kaod.org>
---
 hw/9pfs/9p-xattr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/9pfs/9p-xattr.c b/hw/9pfs/9p-xattr.c
index eec160b3c2ac..d05c1a1c1df5 100644
--- a/hw/9pfs/9p-xattr.c
+++ b/hw/9pfs/9p-xattr.c
@@ -108,6 +108,7 @@ ssize_t v9fs_list_xattr(FsContext *ctx, const char *path,
     g_free(name);
     close_preserve_errno(dirfd);
     if (xattr_len < 0) {
+        g_free(orig_value);
         return -1;
     }
 
-- 
2.7.4

  reply	other threads:[~2017-04-10 14:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10 14:21 [Qemu-devel] [PULL] 9pfs fix for 2.9 2017-04-10 Greg Kurz
2017-04-10 14:21 ` Greg Kurz [this message]
2017-04-11  9:03 ` Peter Maydell

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=1491834095-6476-2-git-send-email-groug@kaod.org \
    --to=groug@kaod.org \
    --cc=liq3ea@gmail.com \
    --cc=liqiang6-s@360.cn \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).