diff options
| author | Qihang Gao <gaoqihang@loongson.cn> | 2026-07-24 05:55:15 +0300 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2026-07-24 14:17:34 +0300 |
| commit | 8d2bbdfb14384d77a5be491d90a8ac35cfa192a8 (patch) | |
| tree | f157984960a90d4729bccd030d3f9ed480cc6364 /MdeModulePkg/Library/PiDxeS3BootScriptLib | |
| parent | f246d215eada6bb9fa7abc81c6aed2b49732f51a (diff) | |
| download | edk2-8d2bbdfb14384d77a5be491d90a8ac35cfa192a8.tar.xz | |
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>
Diffstat (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib')
0 files changed, 0 insertions, 0 deletions
