qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Richard Henderson <rth@twiddle.net>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>, Li Qiang <liq3ea@163.com>
Subject: [Qemu-devel] [PULL 3/5] usb: dev-mtp: fix memory leak in error path
Date: Tue,  8 Jan 2019 16:53:52 +0100	[thread overview]
Message-ID: <20190108155354.8591-4-kraxel@redhat.com> (raw)
In-Reply-To: <20190108155354.8591-1-kraxel@redhat.com>

From: Li Qiang <liq3ea@163.com>

Spotted by Coverity: CID 1397074

Fixes: c52d46e041b
Signed-off-by: Li Qiang <liq3ea@163.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20190103132605.49476-1-liq3ea@163.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.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.9.3

  parent reply	other threads:[~2019-01-08 15:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-08 15:53 [Qemu-devel] [PULL 0/5] Usb 20190108 patches Gerd Hoffmann
2019-01-08 15:53 ` [Qemu-devel] [PULL 1/5] hw/usb: fix mistaken de-initialization of CCID state Gerd Hoffmann
2019-01-08 15:53 ` [Qemu-devel] [PULL 2/5] usb: drop unnecessary usb_device_post_load checks Gerd Hoffmann
2019-01-08 15:53 ` Gerd Hoffmann [this message]
2019-01-08 15:53 ` [Qemu-devel] [PULL 4/5] hw/usb: Add generic sys-bus EHCI controller Gerd Hoffmann
2019-01-09  3:03   ` Hongbo Zhang
2019-01-08 15:53 ` [Qemu-devel] [PULL 5/5] usb: move ehci_create_ich9_with_companions to hw/i386 Gerd Hoffmann
2019-01-08 17:11 ` [Qemu-devel] [PULL 0/5] Usb 20190108 patches 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=20190108155354.8591-4-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=liq3ea@163.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).