Fix potential memory access violation

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11248 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ydong10 2011-01-13 02:25:24 +00:00
parent 96488aa25a
commit ec50ecf2b8
1 changed files with 7 additions and 4 deletions

View File

@ -914,7 +914,8 @@ TcpIoReceive (
FragmentCount = Packet->BlockOpNum;
Fragment = AllocatePool (FragmentCount * sizeof (NET_FRAGMENT));
if (Fragment == NULL) {
return EFI_OUT_OF_RESOURCES;
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
//
// Build the fragment table.
@ -989,7 +990,9 @@ ON_EXIT:
TcpIo->RxToken.Tcp6Token.Packet.RxData = NULL;
}
if (Fragment != NULL) {
FreePool (Fragment);
}
return Status;
}