edk2/StandaloneMmPkg/Core
Qihang Gao 8d2bbdfb14 StandaloneMmPkg/Core: Fix memory leak in MmiHandlerRegister
In MmiHandlerRegister(), the MmiHandler structure is currently
allocated before looking up the target MmiEntry. If the lookup
fails, the function returns an error but the allocated MmiHandler
is never freed, causing a memory leak.

This patch moves the allocation of MmiHandler and its initialization
to after the MmiEntry lookup and validation. This ensures that memory
is only allocated when the operation can succeed, eliminating the need
for a FreePool() on the error path and simplifying the error handling
logic.

Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
Suggested-by: Ray Ni <ray.ni@intel.com>
2026-07-24 11:17:34 +00:00
..
Dependency.c StandaloneMmPkg/Core: Return when processing malformed DEPEX 2026-04-13 13:30:36 +00:00
Dispatcher.c StandaloneMmPkg Core: Check PE section finding status 2026-03-19 02:48:49 +00:00
FwVol.c StandaloneMmPkg Core: Check PE section finding status 2026-03-19 02:48:49 +00:00
Handle.c StandaloneMmPkg: StandaloneMmCore: Log MM Entry/Exit Protocol at Verbose 2026-02-03 01:50:23 +00:00
InstallConfigurationTable.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Locate.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
MemoryAttributesTable.c StandaloneMmPkg/Core: Add MemoryAttributes support 2024-08-28 15:25:27 +00:00
Mmi.c StandaloneMmPkg/Core: Fix memory leak in MmiHandlerRegister 2026-07-24 11:17:34 +00:00
Notify.c StandaloneMmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Page.c StandaloneMmPkg/Core/Page.c: Correct gMemoryMap typo 2026-01-28 14:03:18 +00:00
Pool.c StandaloneMmPkg/Core: Add MemoryAttributes support 2024-08-28 15:25:27 +00:00
StandaloneMmCore.c StandaloneMmPkg/Core: Print discovered drivers that weren't dispatched 2026-02-26 18:57:32 +00:00
StandaloneMmCore.h StandaloneMmPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
StandaloneMmCore.inf StandaloneMmPkg: Correct Build Options for CLANGPDB 2026-01-15 17:10:46 +00:00
StandaloneMmCorePrivateData.h StandaloneMmPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00