[Public]

Reviewed-by: Abner Chang <abner.ch...@amd.com>

> -----Original Message-----
> From: Mike Maslenkin <mike.maslen...@gmail.com>
> Sent: Friday, December 15, 2023 7:25 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner <abner.ch...@amd.com>; nick...@nvidia.com;
> ig...@ami.com; Mike Maslenkin <mike.maslen...@gmail.com>
> Subject: [PATCH v2 04/14] RedfishPkg: RedfishPlatformConfigDxe: reduce
> memory allocations
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> 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: Abner Chang <abner.ch...@amd.com>
> Cc: Nickle Wang <nick...@nvidia.com>
> Cc: Igor Kulchytskyy <ig...@ami.com>
> Signed-off-by: Mike Maslenkin <mike.maslen...@gmail.com>
> ---
>  .../RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c       | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
> index cbc65ba59408..f970e317b3f6 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;
>
>          }
>
>        }
>
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112620): https://edk2.groups.io/g/devel/message/112620
Mute This Topic: https://groups.io/mt/103181039/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to