- Fix a possible crash
authorCameron Gutman <aicommander@gmail.com>
Thu, 14 Aug 2008 17:13:11 +0000 (17:13 +0000)
committerCameron Gutman <aicommander@gmail.com>
Thu, 14 Aug 2008 17:13:11 +0000 (17:13 +0000)
 - Fix 2 memory leaks

svn path=/branches/aicom-network-fixes/; revision=35343

drivers/network/afd/afd/main.c

index a689ce5..ae46188 100644 (file)
@@ -210,8 +210,12 @@ VOID DestroySocket( PAFD_FCB FCB ) {
        ExFreePool( FCB->LocalAddress );
     if( FCB->RemoteAddress )
        ExFreePool( FCB->RemoteAddress );
-
-    ExFreePool(FCB->TdiDeviceName.Buffer);
+    if( FCB->ListenIrp.ConnectionReturnInfo )
+       ExFreePool( FCB->ListenIrp.ConnectionReturnInfo );
+    if( FCB->ListenIrp.ConnectionCallInfo )
+       ExFreePool( FCB->ListenIrp.ConnectionCallInfo );
+    if( FCB->TdiDeviceName.Buffer )
+       ExFreePool(FCB->TdiDeviceName.Buffer);
 
     ExFreePool(FCB);
     AFD_DbgPrint(MIN_TRACE,("Deleted (%x)\n", FCB));