Author: tfaber
Date: Sat Jul 19 17:48:46 2014
New Revision: 63721
URL:
http://svn.reactos.org/svn/reactos?rev=63721&view=rev
Log:
[DISK]
- Fix memory leak in CreatePartitionDeviceObjects
Modified:
trunk/reactos/drivers/storage/class/disk/disk.c
Modified: trunk/reactos/drivers/storage/class/disk/disk.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/disk…
==============================================================================
--- trunk/reactos/drivers/storage/class/disk/disk.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/class/disk/disk.c [iso-8859-1] Sat Jul 19 17:48:46 2014
@@ -1183,7 +1183,7 @@
// Allocate and zero a partition list.
//
- partitionList = ExAllocatePool(NonPagedPool, sizeof(*partitionList ));
+ partitionList = ExAllocatePool(NonPagedPool, sizeof(*partitionList));
if (partitionList != NULL) {
@@ -1446,6 +1446,10 @@
ExFreePool(partitionList);
+ if (dmSkew) {
+ ExFreePool(dmSkew);
+ }
+
} else {
CreatePartitionDeviceObjectsExit:
@@ -1455,6 +1459,10 @@
}
if (initData) {
ExFreePool(initData);
+ }
+
+ if (dmSkew) {
+ ExFreePool(dmSkew);
}
return status;
@@ -1909,7 +1917,7 @@
case EXECUTE_OFFLINE_DIAGS:
controlCode = IOCTL_SCSI_MINIPORT_EXECUTE_OFFLINE_DIAGS;
break;
-
+
default:
status = STATUS_INVALID_PARAMETER;
break;
@@ -2090,13 +2098,13 @@
RtlMoveMemory(Irp->AssociatedIrp.SystemBuffer,
deviceExtension->DiskGeometry,
(irpStack->Parameters.DeviceIoControl.IoControlCode ==
IOCTL_DISK_GET_DRIVE_GEOMETRY) ?
- sizeof(DISK_GEOMETRY) :
+ sizeof(DISK_GEOMETRY) :
sizeof(DISK_GEOMETRY_EX));
status = STATUS_SUCCESS;
Irp->IoStatus.Information =
(irpStack->Parameters.DeviceIoControl.IoControlCode ==
IOCTL_DISK_GET_DRIVE_GEOMETRY) ?
- sizeof(DISK_GEOMETRY) :
+ sizeof(DISK_GEOMETRY) :
sizeof(DISK_GEOMETRY_EX);
}