From c0a0a5a5c76f7aaef30b5010ae1de6236defb445 Mon Sep 17 00:00:00 2001 From: Jiaxin Wu Date: Tue, 26 Dec 2017 11:10:34 +0800 Subject: [PATCH] NetworkPkg/HttpDxe: Fix the memory leak issue in HttpRequest(). Cc: Wang Fan Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Wang Fan Reviewed-by: Fu Siyuan --- NetworkPkg/HttpDxe/HttpImpl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index 57fa39f094..fe1c3b7784 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -472,6 +472,8 @@ EfiHttpRequest ( FreePool (HostName); + HttpUrlFreeParser (UrlParser); + // // Queue the HTTP token and return. // @@ -656,6 +658,10 @@ EfiHttpRequest ( if (HostName != NULL) { FreePool (HostName); } + + if (UrlParser != NULL) { + HttpUrlFreeParser (UrlParser); + } return EFI_SUCCESS; @@ -699,7 +705,7 @@ Error1: if (Wrap != NULL) { FreePool (Wrap); } - if (UrlParser!= NULL) { + if (UrlParser != NULL) { HttpUrlFreeParser (UrlParser); }