]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
ShellPkg/ConsistMapping: Remove unneeded memory reallocation
[mirror_edk2.git] / ShellPkg / Library / UefiShellCommandLib / ConsistMapping.c
index 09f2c563de782bd22658fd531a40a3614252756d..3b13e62340de7c1355688967cd1899ba1fdb0c6f 100755 (executable)
@@ -1,7 +1,7 @@
 /** @file\r
   Main file for support of shell consist mapping.\r
 \r
-  Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2005 - 2017, 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
@@ -1610,7 +1610,6 @@ ShellCommandConsistMappingGenMappingName (
   DEVICE_CONSIST_MAPPING_INFO MappingInfo;\r
   EFI_DEVICE_PATH_PROTOCOL    *HIDevicePath;\r
   UINTN                       Index;\r
-  CHAR16                      *NewStr;\r
 \r
   ASSERT(DevicePath         != NULL);\r
   ASSERT(Table  != NULL);\r
@@ -1667,13 +1666,7 @@ ShellCommandConsistMappingGenMappingName (
     return NULL;\r
   }\r
 \r
-  NewStr = ReallocatePool (Str.Len * sizeof (CHAR16), (Str.Len + 1) * sizeof (CHAR16), Str.Str);\r
-  if (NewStr == NULL) {\r
-    SHELL_FREE_NON_NULL (Str.Str);\r
-    return (NULL);\r
-  }\r
-  NewStr[Str.Len] = CHAR_NULL;\r
-  return NewStr;\r
+  return Str.Str;\r
 }\r
 \r
 /**\r