summaryrefslogtreecommitdiff
path: root/NetworkPkg
diff options
context:
space:
mode:
authorFu Siyuan <siyuan.fu@intel.com>2016-05-05 10:15:47 +0800
committerFu Siyuan <siyuan.fu@intel.com>2016-05-06 10:47:45 +0800
commita1522257a9d56049fb9ad0f00280948f4c09042f (patch)
tree9f7840a9dcdc021a668434bf03bb5a51ea18a946 /NetworkPkg
parent2d6a7af90f84bf1d133a30514afdbae6f4f9e305 (diff)
downloadedk2-platforms-a1522257a9d56049fb9ad0f00280948f4c09042f.tar.xz
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. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/HttpBootDxe/HttpBootConfig.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/NetworkPkg/HttpBootDxe/HttpBootConfig.c b/NetworkPkg/HttpBootDxe/HttpBootConfig.c
index 2ca38b5333..04c2f3efd7 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: