NetworkPkg/HttpBootDxe: Avoid the potential memory leak when eror happen.
Cc: Wang Fan <fan.wang@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Wang Fan <fan.wang@intel.com>
This commit is contained in:
@@ -122,8 +122,9 @@ HttpBootStart (
|
||||
UINTN Index;
|
||||
EFI_STATUS Status;
|
||||
CHAR8 *Uri;
|
||||
|
||||
|
||||
Uri = NULL;
|
||||
|
||||
if (Private == NULL || FilePath == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
@@ -154,6 +155,9 @@ HttpBootStart (
|
||||
//
|
||||
Status = HttpBootStop (Private);
|
||||
if (EFI_ERROR (Status)) {
|
||||
if (Uri != NULL) {
|
||||
FreePool (Uri);
|
||||
}
|
||||
return Status;
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user