summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2017-04-17 14:20:40 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2017-04-18 10:26:25 +0800
commitcbdde352d1a5855455a93482ee14c0b9d356220f (patch)
tree65019a208727e21735e0c5ae3f817a3d8cd1e24c /ShellPkg
parent6efcd38566e6e5cddee4ec98543950f111c4566f (diff)
downloadedk2-cbdde352d1a5855455a93482ee14c0b9d356220f.tar.gz
edk2-cbdde352d1a5855455a93482ee14c0b9d356220f.tar.bz2
edk2-cbdde352d1a5855455a93482ee14c0b9d356220f.zip
ShellPkg/ConsistMapping: Remove unneeded memory reallocation
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 17c3dc19395121486c6f1614dbc564f39763720a)
Diffstat (limited to 'ShellPkg')
-rwxr-xr-xShellPkg/Library/UefiShellCommandLib/ConsistMapping.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c b/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
index 09f2c563de..3b13e62340 100755
--- a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
+++ b/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
@@ -1,7 +1,7 @@
/** @file
Main file for support of shell consist mapping.
- Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1610,7 +1610,6 @@ ShellCommandConsistMappingGenMappingName (
DEVICE_CONSIST_MAPPING_INFO MappingInfo;
EFI_DEVICE_PATH_PROTOCOL *HIDevicePath;
UINTN Index;
- CHAR16 *NewStr;
ASSERT(DevicePath != NULL);
ASSERT(Table != NULL);
@@ -1667,13 +1666,7 @@ ShellCommandConsistMappingGenMappingName (
return NULL;
}
- NewStr = ReallocatePool (Str.Len * sizeof (CHAR16), (Str.Len + 1) * sizeof (CHAR16), Str.Str);
- if (NewStr == NULL) {
- SHELL_FREE_NON_NULL (Str.Str);
- return (NULL);
- }
- NewStr[Str.Len] = CHAR_NULL;
- return NewStr;
+ return Str.Str;
}
/**