From: Andrei Borzenkov Date: Sat, 20 Jun 2015 20:38:19 +0000 (+0300) Subject: ohci: fix memory leak X-Git-Tag: 2.02-beta3~265 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47490ada3ddc24a323a654cef7828f604d9b871a;p=thirdparty%2Fgrub.git ohci: fix memory leak Found by: Coverity scan. CID: 96679 --- diff --git a/grub-core/bus/usb/ohci.c b/grub-core/bus/usb/ohci.c index d27bfe7fb..f0be533d4 100644 --- a/grub-core/bus/usb/ohci.c +++ b/grub-core/bus/usb/ohci.c @@ -750,7 +750,10 @@ grub_ohci_setup_transfer (grub_usb_controller_t dev, { cdata->td_head_virt = grub_ohci_alloc_td (o); if (!cdata->td_head_virt) - return GRUB_USB_ERR_INTERNAL; /* We don't need de-allocate ED */ + { + grub_free (cdata); + return GRUB_USB_ERR_INTERNAL; /* We don't need de-allocate ED */ + } /* We can set td_head only when ED is not active, i.e. * when it is newly allocated. */ cdata->ed_virt->td_head