aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorLi Qiang <liq3ea@163.com>2019-01-03 05:26:05 -0800
committerGerd Hoffmann <kraxel@redhat.com>2019-01-08 12:40:35 +0100
commit8e3759ef04dbd87ad21502e78b068d6473c6b5d9 (patch)
treeedf1cd7a1e54517e1f2a031a89da30b90693a6ac /hw
parentf30815390adb1ec153327c3832ab378e8bce9808 (diff)
downloadqemu-8e3759ef04dbd87ad21502e78b068d6473c6b5d9.zip
qemu-8e3759ef04dbd87ad21502e78b068d6473c6b5d9.tar.gz
qemu-8e3759ef04dbd87ad21502e78b068d6473c6b5d9.tar.bz2
usb: dev-mtp: fix memory leak in error path
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>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb/dev-mtp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 6098005..b19b576 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;
}