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 <[email protected]>
Cc: Igor Kulchytskyy <[email protected]>
Signed-off-by: Mike Maslenkin <[email protected]>
Reviewed-by: Abner Chang <[email protected]>
---
 .../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 (#112863): https://edk2.groups.io/g/devel/message/112863
Mute This Topic: https://groups.io/mt/103354123/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to