Message ID | 1398422894-26658-6-git-send-email-kraxel@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 775dc8d..45f9562 100644 --- 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; }
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> --- hw/usb/dev-mtp.c | 2 ++ 1 file changed, 2 insertions(+)