mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +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;
|
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)
|
switch(ParameterType)
|
||||||
{
|
{
|
||||||
case NdisParameterInteger:
|
case NdisParameterInteger:
|
||||||
|
@ -516,8 +525,15 @@ NdisReadConfiguration(
|
||||||
ExFreePool(*ParameterValue);
|
ExFreePool(*ParameterValue);
|
||||||
*ParameterValue = NULL;
|
*ParameterValue = NULL;
|
||||||
*Status = NDIS_STATUS_FAILURE;
|
*Status = NDIS_STATUS_FAILURE;
|
||||||
} else
|
return;
|
||||||
*Status = NDIS_STATUS_SUCCESS;
|
}
|
||||||
|
|
||||||
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -556,18 +572,6 @@ NdisReadConfiguration(
|
||||||
return;
|
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->ResourceType = 0;
|
||||||
MiniportResource->Resource = *ParameterValue;
|
MiniportResource->Resource = *ParameterValue;
|
||||||
NDIS_DbgPrint(MID_TRACE,("inserting 0x%x into the resource list\n", MiniportResource->Resource));
|
NDIS_DbgPrint(MID_TRACE,("inserting 0x%x into the resource list\n", MiniportResource->Resource));
|
||||||
|
@ -605,17 +609,6 @@ NdisReadConfiguration(
|
||||||
return;
|
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->ResourceType = 0;
|
||||||
MiniportResource->Resource = *ParameterValue;
|
MiniportResource->Resource = *ParameterValue;
|
||||||
NDIS_DbgPrint(MID_TRACE,("inserting 0x%x into the resource list\n", MiniportResource->Resource));
|
NDIS_DbgPrint(MID_TRACE,("inserting 0x%x into the resource list\n", MiniportResource->Resource));
|
||||||
|
|
Loading…
Reference in a new issue