From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 2A8EBAC1BE5 for ; Thu, 26 Oct 2023 23:54:07 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=9xX0tOzeEdEOukvGzfgyaCkgSYlRuzBmC8va+oVtH7Q=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1698364445; v=1; b=V72bmx7Afl8pk5bO5hdh4KS384jOqr6JK2z7A58nOtnBJzMgyuPYR/nuOqtno8ROCPgz3Ml/ 5hMEi6bYvRlAXKZGHxFSUfhETOWxmCyzlw9IP1PEJImVPOtKOPnhzruDeboLMOxkTXtiUgRChg9 2Tacef6FYplQzAwG6FmVq9o0= X-Received: by 127.0.0.2 with SMTP id pNunYY7687511xWTUVyaMtwe; Thu, 26 Oct 2023 16:54:05 -0700 X-Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mx.groups.io with SMTP id smtpd.web11.86067.1698364443795745588 for ; Thu, 26 Oct 2023 16:54:04 -0700 X-Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-507975d34e8so2217228e87.1 for ; Thu, 26 Oct 2023 16:54:03 -0700 (PDT) X-Gm-Message-State: MT1YTB7wsWlvfPIgSIxyYzATx7686176AA= X-Google-Smtp-Source: AGHT+IHotpsy7TY6TDWbT/r8OXwl8NqSYsX/FwzPxf9iTrhCLIPCCedsrU+PtQYwxwhkYgLtr3ZEOg== X-Received: by 2002:ac2:4282:0:b0:507:a12c:558c with SMTP id m2-20020ac24282000000b00507a12c558cmr571578lfh.46.1698364441915; Thu, 26 Oct 2023 16:54:01 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u8-20020a056512040800b00507a8789b43sm39389lfk.269.2023.10.26.16.54.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 26 Oct 2023 16:54:01 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [edk2-redfish-client][PATCH v2 06/11] RedfishClientPkg: fix memory leaks while applying feature settings Date: Fri, 27 Oct 2023 02:53:49 +0300 Message-Id: <20231026235354.67625-7-mike.maslenkin@gmail.com> In-Reply-To: <20231026235354.67625-1-mike.maslenkin@gmail.com> References: <20231026235354.67625-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=V72bmx7A; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Signed-off-by: Mike Maslenkin --- .../RedfishFeatureUtilityLib.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatu= reUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishF= eatureUtilityLib.c index 0941f33fd73a..e189987850f7 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c @@ -806,6 +806,7 @@ ApplyFeatureSettingsStringArrayType ( RedfishValue.Value.StringArray[Index] =3D AllocateCopyPool (AsciiStr= Size (Buffer->ArrayValue), Buffer->ArrayValue);=0D if (RedfishValue.Value.StringArray[Index] =3D=3D NULL) {=0D ASSERT (FALSE);=0D + FreePool (RedfishValue.Value.StringArray);=0D return EFI_OUT_OF_RESOURCES;=0D }=0D =0D @@ -828,6 +829,12 @@ ApplyFeatureSettingsStringArrayType ( DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __fun= c__, Schema, Version, ConfigureLang));=0D }=0D =0D + for (Index =3D 0; Index < RedfishValue.ArrayCount; Index++) {=0D + FreePool (RedfishValue.Value.StringArray[Index]);=0D + }=0D +=0D + FreePool (RedfishValue.Value.StringArray);=0D +=0D return Status;=0D }=0D =0D @@ -927,6 +934,8 @@ ApplyFeatureSettingsNumericArrayType ( DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __fun= c__, Schema, Version, ConfigureLang));=0D }=0D =0D + FreePool (RedfishValue.Value.IntegerArray);=0D +=0D return Status;=0D }=0D =0D @@ -1026,6 +1035,8 @@ ApplyFeatureSettingsBooleanArrayType ( DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __fun= c__, Schema, Version, ConfigureLang));=0D }=0D =0D + FreePool (RedfishValue.Value.BooleanArray);=0D +=0D return Status;=0D }=0D =0D --=20 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110151): https://edk2.groups.io/g/devel/message/110151 Mute This Topic: https://groups.io/mt/102211775/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-