From cdf8c32ec169db14d4824c659159e2b6b6bed540 Mon Sep 17 00:00:00 2001 From: Nagaraj Hegde Date: Fri, 30 Oct 2015 06:47:54 +0000 Subject: 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 Reviewed-by: Samer El-Haj-Mahmoud Reviewed-by: Ye Ting git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18709 6f19259b-4bc3-4df7-8a09-765794883524 --- NetworkPkg/HttpDxe/HttpImpl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'NetworkPkg') diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index 588e1bb649..30944004ae 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: -- cgit v1.2.3