]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
ohci: fix memory leak
authorAndrei Borzenkov <arvidjaar@gmail.com>
Sat, 20 Jun 2015 20:38:19 +0000 (23:38 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Sat, 20 Jun 2015 20:38:19 +0000 (23:38 +0300)
Found by: Coverity scan.
CID: 96679

grub-core/bus/usb/ohci.c

index d27bfe7fb9d40a0eecb721f4b8df152b11decbca..f0be533d41eb7cdb1dc88e79a2195237ea829d20 100644 (file)
@@ -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