]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/ShellEnvVar.c
console logger - support disabling the console out.
[mirror_edk2.git] / ShellPkg / Application / Shell / ShellEnvVar.c
index 519181b56ddbb4e5cb998d4e4b65b40891df8554..174a783830f6ff271e374a21e56aa7364688760a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   function declarations for shell environment functions.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -56,7 +56,7 @@ IsVolatileEnv (
                             &Size,\r
                             Buffer);\r
   if (Status == EFI_BUFFER_TOO_SMALL) {\r
-    Buffer = AllocatePool(Size);\r
+    Buffer = AllocateZeroPool(Size);\r
     ASSERT(Buffer != NULL);\r
     Status = gRT->GetVariable((CHAR16*)EnvVarName,\r
                               &gShellVariableGuid,\r
@@ -154,7 +154,7 @@ GetEnvironmentVariableList(
   }\r
 \r
   NameSize = (UINTN)MaxVarSize;\r
-  VariableName = AllocatePool(NameSize);\r
+  VariableName = AllocateZeroPool(NameSize);\r
   if (VariableName == NULL) {\r
     return (EFI_OUT_OF_RESOURCES);\r
   }\r
@@ -175,7 +175,7 @@ GetEnvironmentVariableList(
         ValSize = 0;\r
         Status = SHELL_GET_ENVIRONMENT_VARIABLE_AND_ATTRIBUTES(VariableName, &VarList->Atts, &ValSize, VarList->Val);\r
         if (Status == EFI_BUFFER_TOO_SMALL){\r
-          VarList->Val = AllocatePool(ValSize);\r
+          VarList->Val = AllocateZeroPool(ValSize);\r
           if (VarList->Val == NULL) {\r
             SHELL_FREE_NON_NULL(VarList);\r
             Status = EFI_OUT_OF_RESOURCES;\r
@@ -184,7 +184,7 @@ GetEnvironmentVariableList(
           }\r
         }\r
         if (!EFI_ERROR(Status) && VarList != NULL) {\r
-          VarList->Key = AllocatePool(StrSize(VariableName));\r
+          VarList->Key = AllocateZeroPool(StrSize(VariableName));\r
           if (VarList->Key == NULL) {\r
             SHELL_FREE_NON_NULL(VarList->Val);\r
             SHELL_FREE_NON_NULL(VarList);\r
@@ -312,7 +312,7 @@ SetEnvironmentVariables(
       break;\r
     }\r
     ASSERT(StrStr(CurrentString, L"=") != NULL);\r
-    Node = AllocatePool(sizeof(ENV_VAR_LIST));\r
+    Node = AllocateZeroPool(sizeof(ENV_VAR_LIST));\r
     ASSERT(Node != NULL);\r
     Node->Key = AllocateZeroPool((StrStr(CurrentString, L"=") - CurrentString + 1) * sizeof(CHAR16));\r
     ASSERT(Node->Key != NULL);\r