summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c')
-rw-r--r--MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
index a391442d16..66f7dffc53 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
@@ -3730,6 +3730,35 @@ UiDisplayMenu (
}
/**
+ Free the UI Menu Option structure data.
+
+ @param MenuOptionList Point to the menu option list which need to be free.
+
+**/
+
+VOID
+FreeMenuOptionData(
+ LIST_ENTRY *MenuOptionList
+ )
+{
+ LIST_ENTRY *Link;
+ UI_MENU_OPTION *Option;
+
+ //
+ // Free menu option list
+ //
+ while (!IsListEmpty (MenuOptionList)) {
+ Link = GetFirstNode (MenuOptionList);
+ Option = MENU_OPTION_FROM_LINK (Link);
+ if (Option->Description != NULL){
+ FreePool(Option->Description);
+ }
+ RemoveEntryList (&Option->Link);
+ FreePool (Option);
+ }
+}
+
+/**
Base on the browser status info to show an pop up message.
@@ -4001,6 +4030,11 @@ FormDisplay (
CopyGuid (&gOldFormEntry.FormSetGuid, &FormData->FormSetGuid);
gOldFormEntry.FormId = FormData->FormId;
+ //
+ //Free the Ui menu option list.
+ //
+ FreeMenuOptionData(&gMenuOption);
+
return Status;
}