Author: cgutman Date: Fri Dec 26 12:18:04 2008 New Revision: 38358
URL: http://svn.reactos.org/svn/reactos?rev=38358&view=rev Log: - Don't free memory allocated with ExAllocateFromNPagedLookasideList by using ExFreePool
Modified: branches/aicom-network-fixes/lib/drivers/ip/network/receive.c
Modified: branches/aicom-network-fixes/lib/drivers/ip/network/receive.c URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/lib/drivers/... ============================================================================== --- branches/aicom-network-fixes/lib/drivers/ip/network/receive.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/lib/drivers/ip/network/receive.c [iso-8859-1] Fri Dec 26 12:18:04 2008 @@ -250,8 +250,7 @@ __inline VOID Cleanup( PKSPIN_LOCK Lock, KIRQL OldIrql, - PIPDATAGRAM_REASSEMBLY IPDR, - PVOID Buffer OPTIONAL) + PIPDATAGRAM_REASSEMBLY IPDR) /* * FUNCTION: Performs cleaning operations on errors * ARGUMENTS: @@ -266,8 +265,6 @@ TcpipReleaseSpinLock(Lock, OldIrql); RemoveIPDR(IPDR); FreeIPDR(IPDR); - if (Buffer) - exFreePool(Buffer); }
@@ -375,7 +372,8 @@ NewHole = CreateHoleDescriptor(Hole->First, FragLast - 1); if (!NewHole) { /* We don't have the resources to process this packet, discard it */ - Cleanup(&IPDR->Lock, OldIrql, IPDR, Hole); + exFreeToNPagedLookasideList(&IPHoleList, Hole); + Cleanup(&IPDR->Lock, OldIrql, IPDR); return; }
@@ -385,9 +383,9 @@
if ((FragLast < Hole->Last) && (MoreFragments)) { /* We can reuse the descriptor for the new hole */ - Hole->First = FragLast + 1; - - /* Put the new hole descriptor in the list */ + Hole->First = FragLast + 1; + + /* Put the new hole descriptor in the list */ InsertTailList(&IPDR->HoleListHead, &Hole->ListEntry); } else exFreeToNPagedLookasideList(&IPHoleList, Hole); @@ -407,7 +405,7 @@ Fragment = exAllocateFromNPagedLookasideList(&IPFragmentList); if (!Fragment) { /* We don't have the resources to process this packet, discard it */ - Cleanup(&IPDR->Lock, OldIrql, IPDR, NULL); + Cleanup(&IPDR->Lock, OldIrql, IPDR); return; }
@@ -417,7 +415,8 @@ Fragment->Data = exAllocatePool(NonPagedPool, Fragment->Size); if (!Fragment->Data) { /* We don't have the resources to process this packet, discard it */ - Cleanup(&IPDR->Lock, OldIrql, IPDR, Fragment); + exFreeToNPagedLookasideList(&IPFragmentList, Fragment); + Cleanup(&IPDR->Lock, OldIrql, IPDR); return; }