mirror of https://github.com/acidanthera/audk.git
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:
parent
96488aa25a
commit
ec50ecf2b8
|
@ -913,8 +913,9 @@ TcpIoReceive (
|
||||||
|
|
||||||
FragmentCount = Packet->BlockOpNum;
|
FragmentCount = Packet->BlockOpNum;
|
||||||
Fragment = AllocatePool (FragmentCount * sizeof (NET_FRAGMENT));
|
Fragment = AllocatePool (FragmentCount * sizeof (NET_FRAGMENT));
|
||||||
if (Fragment == NULL) {
|
if (Fragment == NULL) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
|
goto ON_EXIT;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Build the fragment table.
|
// Build the fragment table.
|
||||||
|
@ -988,8 +989,10 @@ ON_EXIT:
|
||||||
} else {
|
} else {
|
||||||
TcpIo->RxToken.Tcp6Token.Packet.RxData = NULL;
|
TcpIo->RxToken.Tcp6Token.Packet.RxData = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
FreePool (Fragment);
|
if (Fragment != NULL) {
|
||||||
|
FreePool (Fragment);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue