Author: tfaber Date: Thu Feb 23 09:28:20 2017 New Revision: 73892
URL: http://svn.reactos.org/svn/reactos?rev=73892&view=rev Log: [USBSTOR] - Fix error paths around SCSI_REQUEST_BLOCK::DataBuffer. Spotted by curiousone. CORE-12816 #resolve
Modified: trunk/reactos/drivers/usb/usbstor/pdo.c
Modified: trunk/reactos/drivers/usb/usbstor/pdo.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbstor/pdo.c?r... ============================================================================== --- trunk/reactos/drivers/usb/usbstor/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbstor/pdo.c [iso-8859-1] Thu Feb 23 09:28:20 2017 @@ -1041,7 +1041,7 @@ Request->DataBuffer = ExAllocatePoolWithTag(NonPagedPool, DataTransferLength, USB_STOR_TAG); - if (!Request) + if (!Request->DataBuffer) { // // no memory @@ -1061,6 +1061,7 @@ // no memory // IoFreeIrp(Irp); + ExFreePoolWithTag(Request->DataBuffer, USB_STOR_TAG); ExFreePoolWithTag(Request, USB_STOR_TAG); return STATUS_INSUFFICIENT_RESOURCES; } @@ -1173,6 +1174,7 @@ // // free resources // + ExFreePoolWithTag(Request->DataBuffer, USB_STOR_TAG); ExFreePoolWithTag(Request, USB_STOR_TAG); IoFreeIrp(Irp); return Status;