]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg/HttpDxe: Fix the memory leak issue in HttpRequest().
authorJiaxin Wu <jiaxin.wu@intel.com>
Tue, 26 Dec 2017 03:10:34 +0000 (11:10 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Wed, 27 Dec 2017 08:29:41 +0000 (16:29 +0800)
Cc: Wang Fan <fan.wang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
NetworkPkg/HttpDxe/HttpImpl.c

index 57fa39f094e8b8a5d0377272fa0421d767362809..fe1c3b7784e932f56dced4f93ea8927ad27f5e4b 100644 (file)
@@ -472,6 +472,8 @@ EfiHttpRequest (
 \r
           FreePool (HostName);\r
 \r
+          HttpUrlFreeParser (UrlParser);\r
+\r
           //\r
           // Queue the HTTP token and return.\r
           //\r
@@ -656,6 +658,10 @@ EfiHttpRequest (
   if (HostName != NULL) {\r
     FreePool (HostName);\r
   }\r
+\r
+  if (UrlParser != NULL) {\r
+    HttpUrlFreeParser (UrlParser);\r
+  }\r
   \r
   return EFI_SUCCESS;\r
 \r
@@ -699,7 +705,7 @@ Error1:
   if (Wrap != NULL) {\r
     FreePool (Wrap);\r
   }\r
-  if (UrlParser!= NULL) {\r
+  if (UrlParser != NULL) {\r
     HttpUrlFreeParser (UrlParser);\r
   }\r
 \r