[ros-diffs] [cgutman] 38358: - Don't free memory allocated with ExAllocateFromNPagedLookasideList by using ExFreePool

cgutman at svn.reactos.org cgutman at svn.reactos.org
Fri Dec 26 19:18:04 CET 2008


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/ip/network/receive.c?rev=38358&r1=38357&r2=38358&view=diff
==============================================================================
--- 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;
     }
 



More information about the Ros-diffs mailing list