MdeModulePkg/DisplayEngineDxe: Fix small InitializeDisplayEngine leak
[mirror_edk2.git] / MdeModulePkg / Universal / DisplayEngineDxe / FormDisplay.c
index f2eac4d..7390f95 100644 (file)
@@ -4221,11 +4221,13 @@ InitializeDisplayEngine (
     NewString         = HiiGetString (gHiiHandle, STRING_TOKEN (FUNCTION_TEN_STRING), NULL);\r
     ASSERT (NewString != NULL);\r
     FormBrowserEx2->RegisterHotKey (&HotKey, BROWSER_ACTION_SUBMIT, 0, NewString);\r
+    FreePool (NewString);\r
 \r
     HotKey.ScanCode   = SCAN_F9;\r
     NewString         = HiiGetString (gHiiHandle, STRING_TOKEN (FUNCTION_NINE_STRING), NULL);\r
     ASSERT (NewString != NULL);\r
     FormBrowserEx2->RegisterHotKey (&HotKey, BROWSER_ACTION_DEFAULT, EFI_HII_DEFAULT_CLASS_STANDARD, NewString);\r
+    FreePool (NewString);\r
   }\r
 \r
   return EFI_SUCCESS;\r