NetworkPkg/HttpUtilitiesDxe: Free handle buffers after LocateHandleBuffer

Fix memory leaks by adding missing FreePool calls:
free HandleBuffer in HttpUtilitiesDxeUnload.

REF: https://uefi.org/sites/default/files/resources/UEFI_Spec_Final_2.11.pdf
Chapter 7.3.15: "Services - Boot Services.LocateHandleBuffer":
It is the caller's responsibility to call the Boot Service.FreePool when
the caller no longer requires the contents of Buffer.

Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
This commit is contained in:
Dongyan Qian
2025-06-11 11:57:01 +08:00
committed by mergify[bot]
parent 58d3345d8c
commit ef516ea82d

View File

@ -59,7 +59,7 @@ HttpUtilitiesDxeUnload (
EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL
);
if (EFI_ERROR (Status)) {
return Status;
goto Exit;
}
//
@ -72,11 +72,16 @@ HttpUtilitiesDxeUnload (
NULL
);
if (EFI_ERROR (Status)) {
return Status;
goto Exit;
}
}
return EFI_SUCCESS;
Status = EFI_SUCCESS;
Exit:
gBS->FreePool (HandleBuffer);
return Status;
}
/**