Looks good to me. Thanks for addressing my comemnt. (Sorry for late to review 
this. I was not aware of that you send the other review for my comment)
Reviewed-by: Sunny Wang <sunnyw...@hpe.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Fu Siyuan
Sent: Thursday, May 05, 2016 10:16 AM
To: edk2-devel@lists.01.org
Cc: Ye Ting <ting...@intel.com>; Wu Jiaxin <jiaxin...@intel.com>
Subject: [edk2] [Patch] NetworkPkg: Fix a memory leak in HTTP boot driver.

We always need to call EfiBootManagerFreeLoadOption because the memory 
allocated for NewOption (description and device path) is no longer needed.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 NetworkPkg/HttpBootDxe/HttpBootConfig.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/NetworkPkg/HttpBootDxe/HttpBootConfig.c 
b/NetworkPkg/HttpBootDxe/HttpBootConfig.c
index 2ca38b5..04c2f3e 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootConfig.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootConfig.c
@@ -142,9 +142,7 @@ HttpBootAddBootOption (
   }
 
   Status = EfiBootManagerAddLoadOptionVariable (&NewOption, (UINTN) -1);
-  if (EFI_ERROR (Status)) {
-    EfiBootManagerFreeLoadOption (&NewOption);
-  }
+  EfiBootManagerFreeLoadOption (&NewOption);
 
 ON_EXIT:
 
--
2.7.4.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to