mirror of
https://github.com/reactos/reactos.git
synced 2024-05-20 12:22:04 +00:00
[UNIATA] Fix Memory leak while claiming PCI IDE controller (#5053)
HalAssignSlotResources will allocate a new resource list which the caller must free.
This commit is contained in:
parent
cb454ef9ed
commit
08248e83a0
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue