projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9e4eff5
)
usb: mtp: fix error path memory leak
author
Gerd Hoffmann
<kraxel@redhat.com>
Fri, 25 Apr 2014 10:01:55 +0000
(12:01 +0200)
committer
Gerd Hoffmann
<kraxel@redhat.com>
Mon, 5 May 2014 10:57:45 +0000
(12:57 +0200)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/usb/dev-mtp.c
patch
|
blob
|
history
diff --git
a/hw/usb/dev-mtp.c
b/hw/usb/dev-mtp.c
index 775dc8d0b268ee9732f0d029251f89e935a6be84..45f9562c6099efae6de489413481c6417f2411dd 100644
(file)
--- a/
hw/usb/dev-mtp.c
+++ b/
hw/usb/dev-mtp.c
@@
-669,6
+669,7
@@
static MTPData *usb_mtp_get_object(MTPState *s, MTPControl *c,
d->fd = open(o->path, O_RDONLY);
if (d->fd == -1) {
+ usb_mtp_data_free(d);
return NULL;
}
d->length = o->stat.st_size;
@@
-688,6
+689,7
@@
static MTPData *usb_mtp_get_partial_object(MTPState *s, MTPControl *c,
d->fd = open(o->path, O_RDONLY);
if (d->fd == -1) {
+ usb_mtp_data_free(d);
return NULL;
}