From a1522257a9d56049fb9ad0f00280948f4c09042f Mon Sep 17 00:00:00 2001 From: Fu Siyuan Date: Thu, 5 May 2016 10:15:47 +0800 Subject: [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. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan Reviewed-by: Ye Ting Reviewed-by: Sunny Wang Reviewed-By: Wu Jiaxin --- 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 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: -- 2.39.2