mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/SmmCore: Fix memory leak on Profile unregistered.
Issue reported at bugzillar 445. Cc: Jeff Fan <jeff.fan@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
This commit is contained in:
parent
072060a6f8
commit
251779fca7
|
@ -1186,7 +1186,9 @@ SmiHandlerProfileRegisterHandler (
|
|||
|
||||
SmiEntry = SmmCoreFindHardwareSmiEntry (HandlerGuid, TRUE);
|
||||
if (SmiEntry == NULL) {
|
||||
FreePool (SmiHandler->Context);
|
||||
if (SmiHandler->Context != NULL) {
|
||||
FreePool (SmiHandler->Context);
|
||||
}
|
||||
FreePool (SmiHandler);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
@ -1277,6 +1279,9 @@ SmiHandlerProfileUnregisterHandler (
|
|||
SmiHandler = TargetSmiHandler;
|
||||
|
||||
RemoveEntryList (&SmiHandler->Link);
|
||||
if (SmiHandler->Context != NULL) {
|
||||
FreePool (SmiHandler->Context);
|
||||
}
|
||||
FreePool (SmiHandler);
|
||||
|
||||
if (IsListEmpty (&SmiEntry->SmiHandlers)) {
|
||||
|
|
Loading…
Reference in New Issue