Branch: refs/heads/master
Home: https://github.com/tianocore/edk2
Commit: 8d2bbdfb14384d77a5be491d90a8ac35cfa192a8
https://github.com/tianocore/edk2/commit/8d2bbdfb14384d77a5be491d90a8ac35cfa192a8
Author: Qihang Gao <[email protected]>
Date: 2026-07-24 (Fri, 24 Jul 2026)
Changed paths:
M StandaloneMmPkg/Core/Mmi.c
Log Message:
-----------
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 <[email protected]>
Suggested-by: Ray Ni <[email protected]>
To unsubscribe from these emails, change your notification settings at
https://github.com/tianocore/edk2/settings/notifications
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits