mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 18:01:07 +00:00
[DISK]
- Fix memory leak in CreatePartitionDeviceObjects svn path=/trunk/; revision=63721
This commit is contained in:
parent
6be6b3b4d4
commit
5884949d32
|
@ -1183,7 +1183,7 @@ CreatePartitionDeviceObjects(
|
|||
// Allocate and zero a partition list.
|
||||
//
|
||||
|
||||
partitionList = ExAllocatePool(NonPagedPool, sizeof(*partitionList ));
|
||||
partitionList = ExAllocatePool(NonPagedPool, sizeof(*partitionList));
|
||||
|
||||
|
||||
if (partitionList != NULL) {
|
||||
|
@ -1446,6 +1446,10 @@ CreatePartitionDeviceObjects(
|
|||
|
||||
ExFreePool(partitionList);
|
||||
|
||||
if (dmSkew) {
|
||||
ExFreePool(dmSkew);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
CreatePartitionDeviceObjectsExit:
|
||||
|
@ -1457,6 +1461,10 @@ CreatePartitionDeviceObjectsExit:
|
|||
ExFreePool(initData);
|
||||
}
|
||||
|
||||
if (dmSkew) {
|
||||
ExFreePool(dmSkew);
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
} // end if...else
|
||||
|
@ -1909,7 +1917,7 @@ Return Value:
|
|||
case EXECUTE_OFFLINE_DIAGS:
|
||||
controlCode = IOCTL_SCSI_MINIPORT_EXECUTE_OFFLINE_DIAGS;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
status = STATUS_INVALID_PARAMETER;
|
||||
break;
|
||||
|
@ -2090,13 +2098,13 @@ Return Value:
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue