In MmCoreFfsFindMmDriver(), ScratchBuffer is not freed in the error return path that DstBuffer page allocation fails. Free ScratchBuffer before return with error.
Cc: Laszlo Ersek <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Sami Mujawar <[email protected]> Cc: Ray Ni <[email protected]> Signed-off-by: Wei6 Xu <[email protected]> --- StandaloneMmPkg/Core/FwVol.c | 1 + 1 file changed, 1 insertion(+) diff --git a/StandaloneMmPkg/Core/FwVol.c b/StandaloneMmPkg/Core/FwVol.c index e1e20ffd14ac..9d0ce66ef839 100644 --- a/StandaloneMmPkg/Core/FwVol.c +++ b/StandaloneMmPkg/Core/FwVol.c @@ -150,6 +150,7 @@ MmCoreFfsFindMmDriver ( // DstBuffer = (VOID *)(UINTN)AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize)); if (DstBuffer == NULL) { + FreePages (ScratchBuffer, EFI_SIZE_TO_PAGES (ScratchBufferSize)); return EFI_OUT_OF_RESOURCES; } -- 2.29.2.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110298): https://edk2.groups.io/g/devel/message/110298 Mute This Topic: https://groups.io/mt/102270547/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
