]> git.proxmox.com Git - mirror_edk2.git/blobdiff - InOsEmuPkg/Library/ThunkProtocolList/ThunkProtocolList.c
InOsEmuPkg/Unix/Sec: Add BaseMemoryLib implementation to thunk layer
[mirror_edk2.git] / InOsEmuPkg / Library / ThunkProtocolList / ThunkProtocolList.c
index 3c53716765a237b1b56d6cd4f4c0e8a0b70b4a95..5aed594b6ed6f912d18a4583cc4c47d70a0a747a 100644 (file)
@@ -2,6 +2,7 @@
   Emulator Thunk to abstract OS services from pure EFI code\r
 \r
   Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>\r
+  Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
   \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
 #include <Library/BaseLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/DebugLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
 \r
 #include <Protocol/EmuIoThunk.h>\r
 \r
-#include <stdlib.h>\r
-\r
 \r
 #define EMU_IO_THUNK_PROTOCOL_DATA_SIGNATURE SIGNATURE_32('E','m','u','T')\r
 \r
@@ -53,7 +53,7 @@ AddThunkProtocol (
   }\r
   \r
   Instance = 0;\r
-  StartString = malloc (StrSize (ConfigString));\r
+  StartString = AllocatePool (StrSize (ConfigString));\r
   StrCpy (StartString, ConfigString);\r
   while (*StartString != '\0') {\r
 \r
@@ -74,7 +74,7 @@ AddThunkProtocol (
       SubString++;\r
     }\r
 \r
-    Private = malloc (sizeof (EMU_IO_THUNK_PROTOCOL_DATA));\r
+    Private = AllocatePool (sizeof (EMU_IO_THUNK_PROTOCOL_DATA));\r
     if (Private == NULL) {\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r