summaryrefslogtreecommitdiffstats
path: root/RedfishPkg/RedfishPlatformConfigDxe
diff options
context:
space:
mode:
authorMike Maslenkin <mike.maslenkin@gmail.com>2023-08-30 00:33:07 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-12-27 00:09:49 +0000
commitd81813368a66c1b27f58ecc68e75d1bc850a3e96 (patch)
tree89824e5729eaf44c76d05b35f0faaa64229c7be6 /RedfishPkg/RedfishPlatformConfigDxe
parent0f66c2e687fd789c36ad8f9939449954482bfd21 (diff)
downloadedk2-d81813368a66c1b27f58ecc68e75d1bc850a3e96.tar.gz
edk2-d81813368a66c1b27f58ecc68e75d1bc850a3e96.tar.bz2
edk2-d81813368a66c1b27f58ecc68e75d1bc850a3e96.zip
RedfishPkg: RedfishPlatformConfigDxe: reduce memory allocations
It's unclear why the new string is allocated as copy of the original string if its pointer is stored in an array and the original string is released immediately after the copy is created. All data allocated in the same pool. Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com> Reviewed-by: Abner Chang <abner.chang@amd.com>
Diffstat (limited to 'RedfishPkg/RedfishPlatformConfigDxe')
-rw-r--r--RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
index cbc65ba594..f970e317b3 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
@@ -2057,9 +2057,7 @@ RedfishPlatformConfigProtocolGetConfigureLang (
TmpString = HiiGetRedfishString (StatementRef->Statement->ParentForm->ParentFormset->HiiHandle, FullSchema, StatementRef->Statement->Description);
ASSERT (TmpString != NULL);
if (TmpString != NULL) {
- TmpConfigureLangList[Index] = AllocateCopyPool (StrSize (TmpString), TmpString);
- ASSERT (TmpConfigureLangList[Index] != NULL);
- FreePool (TmpString);
+ TmpConfigureLangList[Index] = TmpString;
++Index;
}
}