Revision: 18709
          http://sourceforge.net/p/edk2/code/18709
Author:   tye1
Date:     2015-10-30 06:47:54 +0000 (Fri, 30 Oct 2015)
Log Message:
-----------
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.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Nagaraj Hegde <[email protected]>
Reviewed-by: Samer El-Haj-Mahmoud <[email protected]>
Reviewed-by: Ye Ting <[email protected]>

Modified Paths:
--------------
    trunk/edk2/NetworkPkg/HttpDxe/HttpImpl.c

Modified: trunk/edk2/NetworkPkg/HttpDxe/HttpImpl.c
===================================================================
--- trunk/edk2/NetworkPkg/HttpDxe/HttpImpl.c    2015-10-29 14:17:31 UTC (rev 
18708)
+++ trunk/edk2/NetworkPkg/HttpDxe/HttpImpl.c    2015-10-30 06:47:54 UTC (rev 
18709)
@@ -485,10 +485,6 @@
     goto Error4;
   }
 
-  if (HostName != NULL) {
-    FreePool (HostName);
-  }
-
   //
   // Transmit the request message.
   //
@@ -504,6 +500,10 @@
 
   DispatchDpc ();
 
+  if (HostName != NULL) {
+    FreePool (HostName);
+  }
+
   return EFI_SUCCESS;
 
 Error5:


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to