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:
committed by
mergify[bot]
parent
58d3345d8c
commit
ef516ea82d
@@ -59,7 +59,7 @@ HttpUtilitiesDxeUnload (
|
|||||||
EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL
|
EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -72,11 +72,16 @@ HttpUtilitiesDxeUnload (
|
|||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
goto Exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
|
|
||||||
|
Exit:
|
||||||
|
gBS->FreePool (HandleBuffer);
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user