[AMD Official Use Only - General] Reviewed-by: Abner Chang <[email protected]>
> -----Original Message----- > From: Mike Maslenkin <[email protected]> > Sent: Saturday, September 30, 2023 5:59 AM > To: [email protected] > Cc: Chang, Abner <[email protected]>; [email protected]; > [email protected]; Mike Maslenkin <[email protected]> > 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 <[email protected]> > --- > .../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: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
