]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: HttpDxe sometimes free a pointer twice
authorNagaraj Hegde <nagaraj-p.hegde@hpe.com>
Fri, 30 Oct 2015 06:47:54 +0000 (06:47 +0000)
committertye1 <tye1@Edk2>
Fri, 30 Oct 2015 06:47:54 +0000 (06:47 +0000)
In EfiHttpRequest, HostName was getting freed twice whenever
HttpTransmitTcp4 failed. Moved FreePool (HostName) after
HttpTransmitTcp4 call to avoid a double free.

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/trunk/edk2@18709 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/HttpDxe/HttpImpl.c

index 588e1bb6499e155dbf8d07da89fa3b5e92c13976..30944004ae2a41b0ea3f7627a2f9e38a075d539a 100644 (file)
@@ -485,10 +485,6 @@ EfiHttpRequest (
     goto Error4;\r
   }\r
 \r
-  if (HostName != NULL) {\r
-    FreePool (HostName);\r
-  }\r
-\r
   //\r
   // Transmit the request message.\r
   //\r
@@ -504,6 +500,10 @@ EfiHttpRequest (
 \r
   DispatchDpc ();\r
 \r
+  if (HostName != NULL) {\r
+    FreePool (HostName);\r
+  }\r
+\r
   return EFI_SUCCESS;\r
 \r
 Error5:\r