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
This commit is contained in:
xdu2 2009-12-25 09:49:38 +00:00
parent 41335d2244
commit 29056ed2de
1 changed files with 9 additions and 7 deletions

View File

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