mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
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> |
||
|---|---|---|
| .. | ||
| Dependency.c | ||
| Dispatcher.c | ||
| FwVol.c | ||
| Handle.c | ||
| InstallConfigurationTable.c | ||
| Locate.c | ||
| MemoryAttributesTable.c | ||
| Mmi.c | ||
| Notify.c | ||
| Page.c | ||
| Pool.c | ||
| StandaloneMmCore.c | ||
| StandaloneMmCore.h | ||
| StandaloneMmCore.inf | ||
| StandaloneMmCorePrivateData.h | ||