Commit in reactos/drivers/net/afd/afd on MAIN
main.c+14-71.17 -> 1.18
Fix crash when closing unconnected socket

reactos/drivers/net/afd/afd
main.c 1.17 -> 1.18
diff -u -r1.17 -r1.18
--- main.c	25 Dec 2004 21:30:17 -0000	1.17
+++ main.c	29 Dec 2004 21:44:44 -0000	1.18
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.17 2004/12/25 21:30:17 arty Exp $
+/* $Id: main.c,v 1.18 2004/12/29 21:44:44 gvg Exp $
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/net/afd/afd/main.c
@@ -244,12 +244,19 @@
 	return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY,
 				       Irp, 0, NULL, FALSE );
 
-    Status = TdiBuildNullConnectionInfo
-	( &ConnInfo, FCB->RemoteAddress->Address[0].AddressType );
-
-    if( !NT_SUCCESS(Status) || !ConnInfo ) 
-	return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY,
-				       Irp, 0, NULL, TRUE );
+    if (NULL == FCB->RemoteAddress)
+      {
+        ConnInfo = NULL;
+      }
+    else
+      {
+	Status = TdiBuildNullConnectionInfo
+	    ( &ConnInfo, FCB->RemoteAddress->Address[0].AddressType );
+
+	if( !NT_SUCCESS(Status) || !ConnInfo ) 
+	    return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY,
+					   Irp, 0, NULL, TRUE );
+      }
 
     if( DisReq->DisconnectType & AFD_DISCONNECT_SEND )
 	Flags |= TDI_DISCONNECT_RELEASE;
CVSspam 0.2.8