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>
}\r
\r
Status = EfiBootManagerAddLoadOptionVariable (&NewOption, (UINTN) -1);\r
- if (EFI_ERROR (Status)) {\r
- EfiBootManagerFreeLoadOption (&NewOption);\r
- }\r
+ EfiBootManagerFreeLoadOption (&NewOption);\r
\r
ON_EXIT:\r
\r