All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Qiang <liq3ea@163.com>
To: kraxel@redhat.com
Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org,
	Li Qiang <liq3ea@163.com>
Subject: [Qemu-devel] [PATCH] usb: dev-mtp: fix memory leak in error path
Date: Thu,  3 Jan 2019 05:26:05 -0800	[thread overview]
Message-ID: <20190103132605.49476-1-liq3ea@163.com> (raw)

Spotted by Coverity: CID 1397074

Signed-off-by: Li Qiang <liq3ea@163.com>
---
 hw/usb/dev-mtp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 6098005cd4..b19b576278 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -1729,6 +1729,7 @@ static void usb_mtp_write_metadata(MTPState *s, uint64_t dlen)
     if (strchr(filename, '/')) {
         usb_mtp_queue_result(s, RES_PARAMETER_NOT_SUPPORTED, d->trans,
                              0, 0, 0, 0);
+        g_free(filename);
         return;
     }
 
-- 
2.17.1

             reply	other threads:[~2019-01-03 13:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-03 13:26 Li Qiang [this message]
2019-01-03 13:38 ` [Qemu-devel] [PATCH] usb: dev-mtp: fix memory leak in error path Philippe Mathieu-Daudé
2019-01-03 13:45   ` [Qemu-devel] 答复: " Li Qiang
2019-01-08 11:41   ` [Qemu-devel] " Gerd Hoffmann

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=20190103132605.49476-1-liq3ea@163.com \
    --to=liq3ea@163.com \
    --cc=kraxel@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.