summaryrefslogtreecommitdiff
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
parent41335d22448da9019e95a76bb8e8f10f231222e0 (diff)
downloadedk2-29056ed2de064a03301e96919a61c2d188e4b66e.zip
edk2-29056ed2de064a03301e96919a61c2d188e4b66e.tar.gz
edk2-29056ed2de064a03301e96919a61c2d188e4b66e.tar.bz2
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
-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 d38c101..2b924c4 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);
}