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>
This commit is contained in:
Fu Siyuan 2016-05-05 10:15:47 +08:00
parent 2d6a7af90f
commit a1522257a9
1 changed files with 1 additions and 3 deletions

View File

@ -142,9 +142,7 @@ HttpBootAddBootOption (
}
Status = EfiBootManagerAddLoadOptionVariable (&NewOption, (UINTN) -1);
if (EFI_ERROR (Status)) {
EfiBootManagerFreeLoadOption (&NewOption);
}
ON_EXIT: