]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c
free allocated memory in error handler.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbKbDxe / EfiKey.c
index da6ce75b3a8daf59a64d4e3ad453b39ece28cb17..b8a665cff57760ba7456f94544499e33fe96a73f 100644 (file)
@@ -394,6 +394,12 @@ ErrorExit:
     if (UsbKeyboardDevice->SimpleInputEx.WaitForKeyEx != NULL) {\r
       gBS->CloseEvent (UsbKeyboardDevice->SimpleInputEx.WaitForKeyEx);\r
     }\r
+    if (UsbKeyboardDevice->KeyboardLayoutEvent != NULL) {\r
+      gBS->CloseEvent (UsbKeyboardDevice->KeyboardLayoutEvent);\r
+    }\r
+    if (UsbKeyboardDevice->KeyConvertionTable != NULL) {\r
+      FreePool (UsbKeyboardDevice->KeyConvertionTable);\r
+    }\r
     FreePool (UsbKeyboardDevice);\r
     UsbKeyboardDevice = NULL;\r
   }\r