summaryrefslogtreecommitdiff
path: root/NetworkPkg/HttpDxe
diff options
context:
space:
mode:
authorNagaraj Hegde <nagaraj-p.hegde@hpe.com>2015-11-16 08:18:01 +0000
committervanjeff <vanjeff@Edk2>2015-11-16 08:18:01 +0000
commit69015f48a9651c3c9b44c3e8e3baab7d98db5333 (patch)
tree2aa87e3c5b45385ca6a71d8553a1aaa273b3ce7f /NetworkPkg/HttpDxe
parent62f3bd24e0e16203b568a7a637633e8cf6c1d40e (diff)
downloadedk2-platforms-69015f48a9651c3c9b44c3e8e3baab7d98db5333.tar.xz
NetworkPkg: HttpDxe sometimes free a pointer twice
In EfiHttpRequest, HostName was getting freed twice whenever HttpTransmitTcp4 failed. Moved FreePool (HostName) after HttpTransmitTcp4 call to avoid a double free. (Sync patch r18709 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Nagaraj Hegde <nagaraj-p.hegde@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18819 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg/HttpDxe')
-rw-r--r--NetworkPkg/HttpDxe/HttpImpl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index 50c0617436..09ee379150 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -486,10 +486,6 @@ EfiHttpRequest (
goto Error4;
}
- if (HostName != NULL) {
- FreePool (HostName);
- }
-
//
// Transmit the request message.
//
@@ -505,6 +501,10 @@ EfiHttpRequest (
DispatchDpc ();
+ if (HostName != NULL) {
+ FreePool (HostName);
+ }
+
return EFI_SUCCESS;
Error5: