summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-01-13 02:25:24 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-01-13 02:25:24 +0000
commitec50ecf2b8f2b011b8cd66e53668fef7624aed88 (patch)
tree90a956f93cad62d971bbb755c887f68ac5088b55 /MdeModulePkg
parent96488aa25a3876bb888b08fc34c8bfafc29016af (diff)
downloadedk2-ec50ecf2b8f2b011b8cd66e53668fef7624aed88.tar.gz
edk2-ec50ecf2b8f2b011b8cd66e53668fef7624aed88.tar.bz2
edk2-ec50ecf2b8f2b011b8cd66e53668fef7624aed88.zip
Fix potential memory access violation
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11248 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c11
1 files changed, 7 insertions, 4 deletions
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;
}