Looks good to me. 

Reviewed-by: Ye Ting <[email protected]> 

-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of Nagaraj 
Hegde
Sent: Wednesday, October 28, 2015 4:54 PM
To: [email protected]
Cc: Nagaraj Hegde
Subject: [edk2] [PATCH] NetworkPkg: HttpDxe: Address double FreePool issue

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]>
---
 NetworkPkg/HttpDxe/HttpImpl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index 588e1bb..3094400 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -485,10 +485,6 @@ EfiHttpRequest (
     goto Error4;
   }
 
-  if (HostName != NULL) {
-    FreePool (HostName);
-  }
-
   //
   // Transmit the request message.
   //
@@ -504,6 +500,10 @@ EfiHttpRequest (
 
   DispatchDpc ();
 
+  if (HostName != NULL) {
+    FreePool (HostName);
+  }
+
   return EFI_SUCCESS;
 
 Error5:
-- 
2.6.2.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to