]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add check before free DevicePath (TCP child sock will have no device path installed)
authorxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 25 Dec 2009 09:49:38 +0000 (09:49 +0000)
committerxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 25 Dec 2009 09:49:38 +0000 (09:49 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9617 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c

index d38c10172e5c82b004c192e7d009197ff9f3ae6e..2b924c4b4b954fe80901729fb0e191e545759444 100644 (file)
@@ -227,14 +227,16 @@ Tcp4FlushPcb (
     RemoveEntryList (&Tcb->List);\r
 \r
     //\r
-    // Uninstall the device path protocl.\r
+    // Uninstall the device path protocol.\r
     //\r
-    gBS->UninstallProtocolInterface (\r
-           Sock->SockHandle,\r
-           &gEfiDevicePathProtocolGuid,\r
-           Sock->DevicePath\r
-           );\r
-    FreePool (Sock->DevicePath);\r
+    if (Sock->DevicePath != NULL) {\r
+      gBS->UninstallProtocolInterface (\r
+             Sock->SockHandle,\r
+             &gEfiDevicePathProtocolGuid,\r
+             Sock->DevicePath\r
+             );\r
+      FreePool (Sock->DevicePath);\r
+    }\r
 \r
     TcpSetVariableData (TcpProto->TcpService);\r
   }\r