Skip to content

Commit

Permalink
RedfishPkg: RedfishPlatformConfigDxe: reduce memory allocations
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ghbaccount authored and mergify[bot] committed Dec 27, 2023
1 parent 0f66c2e commit d818133
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit d818133

Please sign in to comment.