[AMD Official Use Only - General] Reviewed-by: Abner Chang <abner.ch...@amd.com>
> -----Original Message----- > From: Mike Maslenkin <mike.maslen...@gmail.com> > Sent: Saturday, September 30, 2023 5:59 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 6/9] RedfishClientPkg: fix memory leaks while applying > feature settings > > Caution: This message originated from an External Source. Use proper caution > when opening attachments, clicking links, or responding. > > > Signed-off-by: Mike Maslenkin <mike.maslen...@gmail.com> > --- > .../RedfishFeatureUtilityLib.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib. > c > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib. > c > index 0941f33fd73a..e189987850f7 100644 > --- > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib. > c > +++ > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib. > c > @@ -806,6 +806,7 @@ ApplyFeatureSettingsStringArrayType ( > RedfishValue.Value.StringArray[Index] = AllocateCopyPool (AsciiStrSize > (Buffer->ArrayValue), Buffer->ArrayValue); > > if (RedfishValue.Value.StringArray[Index] == NULL) { > > ASSERT (FALSE); > > + FreePool (RedfishValue.Value.StringArray); > > return EFI_OUT_OF_RESOURCES; > > } > > > > @@ -828,6 +829,12 @@ ApplyFeatureSettingsStringArrayType ( > DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", > __func__, Schema, Version, ConfigureLang)); > > } > > > > + for (Index = 0; Index < RedfishValue.ArrayCount; Index++) { > > + FreePool (RedfishValue.Value.StringArray[Index]); > > + } > > + > > + FreePool (RedfishValue.Value.StringArray); > > + > > return Status; > > } > > > > @@ -927,6 +934,8 @@ ApplyFeatureSettingsNumericArrayType ( > DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", > __func__, Schema, Version, ConfigureLang)); > > } > > > > + FreePool (RedfishValue.Value.IntegerArray); > > + > > return Status; > > } > > > > @@ -1026,6 +1035,8 @@ ApplyFeatureSettingsBooleanArrayType ( > DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", > __func__, Schema, Version, ConfigureLang)); > > } > > > > + FreePool (RedfishValue.Value.BooleanArray); > > + > > return Status; > > } > > > > -- > 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109246): https://edk2.groups.io/g/devel/message/109246 Mute This Topic: https://groups.io/mt/101667465/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-