mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
- Fix a memory leak
svn path=/branches/aicom-network-fixes/; revision=36592
This commit is contained in:
parent
576e6e7961
commit
9536865b31
1 changed files with 18 additions and 25 deletions
|
@ -479,6 +479,15 @@ NdisReadConfiguration(
|
|||
return;
|
||||
}
|
||||
|
||||
MiniportResource = ExAllocatePool(PagedPool, sizeof(MINIPORT_RESOURCE));
|
||||
if(!MiniportResource)
|
||||
{
|
||||
NDIS_DbgPrint(MIN_TRACE,("Insufficient resources.\n"));
|
||||
ExFreePool(KeyInformation);
|
||||
*Status = NDIS_STATUS_RESOURCES;
|
||||
return;
|
||||
}
|
||||
|
||||
switch(ParameterType)
|
||||
{
|
||||
case NdisParameterInteger:
|
||||
|
@ -516,8 +525,15 @@ NdisReadConfiguration(
|
|||
ExFreePool(*ParameterValue);
|
||||
*ParameterValue = NULL;
|
||||
*Status = NDIS_STATUS_FAILURE;
|
||||
} else
|
||||
*Status = NDIS_STATUS_SUCCESS;
|
||||
return;
|
||||
}
|
||||
|
||||
MiniportResource->ResourceType = 0;
|
||||
MiniportResource->Resource = *ParameterValue;
|
||||
NDIS_DbgPrint(MID_TRACE,("inserting 0x%x into the resource list\n", MiniportResource->Resource));
|
||||
ExInterlockedInsertTailList(&ConfigurationContext->ResourceListHead, &MiniportResource->ListEntry, &ConfigurationContext->ResourceLock);
|
||||
|
||||
*Status = NDIS_STATUS_SUCCESS;
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -556,18 +572,6 @@ NdisReadConfiguration(
|
|||
return;
|
||||
}
|
||||
|
||||
MiniportResource = ExAllocatePool(PagedPool, sizeof(MINIPORT_RESOURCE));
|
||||
if(!MiniportResource)
|
||||
{
|
||||
NDIS_DbgPrint(MIN_TRACE,("Insufficient resources.\n"));
|
||||
ExFreePool(RegData);
|
||||
ExFreePool(KeyInformation);
|
||||
ExFreePool(*ParameterValue);
|
||||
*ParameterValue = NULL;
|
||||
*Status = NDIS_STATUS_RESOURCES;
|
||||
return;
|
||||
}
|
||||
|
||||
MiniportResource->ResourceType = 0;
|
||||
MiniportResource->Resource = *ParameterValue;
|
||||
NDIS_DbgPrint(MID_TRACE,("inserting 0x%x into the resource list\n", MiniportResource->Resource));
|
||||
|
@ -605,17 +609,6 @@ NdisReadConfiguration(
|
|||
return;
|
||||
}
|
||||
|
||||
MiniportResource = ExAllocatePool(PagedPool, sizeof(MINIPORT_RESOURCE));
|
||||
if(!MiniportResource)
|
||||
{
|
||||
NDIS_DbgPrint(MIN_TRACE,("Insufficient resources.\n"));
|
||||
ExFreePool(KeyInformation);
|
||||
ExFreePool(*ParameterValue);
|
||||
*ParameterValue = NULL;
|
||||
*Status = NDIS_STATUS_RESOURCES;
|
||||
return;
|
||||
}
|
||||
|
||||
MiniportResource->ResourceType = 0;
|
||||
MiniportResource->Resource = *ParameterValue;
|
||||
NDIS_DbgPrint(MID_TRACE,("inserting 0x%x into the resource list\n", MiniportResource->Resource));
|
||||
|
|
Loading…
Reference in a new issue