summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network
diff options
context:
space:
mode:
authorxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-12-25 09:49:38 +0000
committerxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-12-25 09:49:38 +0000
commit29056ed2de064a03301e96919a61c2d188e4b66e (patch)
treed1c8267f8e256f8adeddb4d641306dfa245b194d /MdeModulePkg/Universal/Network
parent41335d22448da9019e95a76bb8e8f10f231222e0 (diff)
downloadedk2-platforms-29056ed2de064a03301e96919a61c2d188e4b66e.tar.xz
Add check before free DevicePath (TCP child sock will have no device path installed)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9617 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network')
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
index d38c10172e..2b924c4b4b 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
@@ -227,14 +227,16 @@ Tcp4FlushPcb (
RemoveEntryList (&Tcb->List);
//
- // Uninstall the device path protocl.
+ // Uninstall the device path protocol.
//
- gBS->UninstallProtocolInterface (
- Sock->SockHandle,
- &gEfiDevicePathProtocolGuid,
- Sock->DevicePath
- );
- FreePool (Sock->DevicePath);
+ if (Sock->DevicePath != NULL) {
+ gBS->UninstallProtocolInterface (
+ Sock->SockHandle,
+ &gEfiDevicePathProtocolGuid,
+ Sock->DevicePath
+ );
+ FreePool (Sock->DevicePath);
+ }
TcpSetVariableData (TcpProto->TcpService);
}