diff --git a/drivers/storage/ide/uniata/id_probe.cpp b/drivers/storage/ide/uniata/id_probe.cpp index 1ca49d248ec..c950e6f9d8f 100644 --- a/drivers/storage/ide/uniata/id_probe.cpp +++ b/drivers/storage/ide/uniata/id_probe.cpp @@ -1941,8 +1941,11 @@ UniataClaimLegacyPCIIDE( ) { NTSTATUS status; - PCM_RESOURCE_LIST resourceList = NULL; UNICODE_STRING devname; + PCM_RESOURCE_LIST resourceList = NULL; +#ifdef __REACTOS__ + PCM_RESOURCE_LIST oldResList = NULL; +#endif KdPrint2((PRINT_PREFIX "UniataClaimLegacyPCIIDE:\n")); @@ -1970,6 +1973,10 @@ UniataClaimLegacyPCIIDE( del_do: IoDeleteDevice(BMList[i].PciIdeDevObj); BMList[i].PciIdeDevObj = NULL; +#ifdef __REACTOS__ + if (oldResList) + ExFreePool(oldResList); +#endif return status; } @@ -1977,6 +1984,10 @@ del_do: resourceList, sizeof(CM_RESOURCE_LIST)); +#ifdef __REACTOS__ + oldResList = resourceList; +#endif + // IoReportDetectedDevice() should be used for WDM OSes // TODO: check if resourceList is actually used inside HalAssignSlotResources() @@ -2006,6 +2017,11 @@ del_do: goto del_do; } +#ifdef __REACTOS__ + ExFreePool(resourceList); + ExFreePool(oldResList); +#endif + KdPrint2((PRINT_PREFIX "ok %#x\n", status)); BMList[i].ChanInitOk |= 0x80;