X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FLibrary%2FDxeTcpIoLib%2FDxeTcpIoLib.c;fp=MdeModulePkg%2FLibrary%2FDxeTcpIoLib%2FDxeTcpIoLib.c;h=2a65422e1c5875b1d7946395766be818b7df73fe;hb=ec50ecf2b8f2b011b8cd66e53668fef7624aed88;hp=110e4890c88f9c244c7febe002a76e33cfbd0dce;hpb=96488aa25a3876bb888b08fc34c8bfafc29016af;p=mirror_edk2.git diff --git a/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c b/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c index 110e4890c8..2a65422e1c 100644 --- a/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c +++ b/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c @@ -913,8 +913,9 @@ TcpIoReceive ( FragmentCount = Packet->BlockOpNum; Fragment = AllocatePool (FragmentCount * sizeof (NET_FRAGMENT)); - if (Fragment == NULL) { - return EFI_OUT_OF_RESOURCES; + if (Fragment == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto ON_EXIT; } // // Build the fragment table. @@ -988,8 +989,10 @@ ON_EXIT: } else { TcpIo->RxToken.Tcp6Token.Packet.RxData = NULL; } - - FreePool (Fragment); + + if (Fragment != NULL) { + FreePool (Fragment); + } return Status; }