From nobody Tue Feb 10 02:49:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+110151+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110151+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698364444; cv=none; d=zohomail.com; s=zohoarc; b=PJLJk4/RmbbiyjEtodW8HKSJb9OB3jKP7tN3RZWQJ4AI6FNCPCqVR6eL33Y7Kg5q/+NrSaze+6DWkvMFJTpd7Ju71VcxDFuIN0PP6vqe3XPdCeQnKCdceSVZNa2g0bu5pEH5Yc150VeKKuzdcAQ+TFdEDPJgm8MH8Vk0QT7EXP0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698364444; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=SZVCiQoNabO4LjoYJrVygiqfe2ZhMuCJjdvijEt/JCU=; b=b39Pp+Aqyz2jk9WcEc4a9jXOFf4Cqzrm8Q6H0LeBFAiQxOd/lxHv3V0O2DWtELoab1I8qwmWKUw0JpgZDE0H8jp+OWq14HJD4jUVBM+kj87iXde6m6KVxcAzpxm2pIrfTsC/exLQUjerkv/WSPOlHBTOFw6kK50jENQTkgZbmDg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110151+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16983644449211008.144635240082; Thu, 26 Oct 2023 16:54:04 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=VxHADRnO94uK0zoIArXNIM2MvdF8EM6S94wrlSjpYDs=; 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=1698364444; v=1; b=jOgRLd8nxy1L0GQHo8C2gSaFjbwUSdxv6lLYVe+HDxfdP9aMVR8Bm3Lr9+RzHUBCY+mno+oZ o6d7hUFJByjiaYMhI4Qn6LSgA1Ew44ILeB5eM4UH3ySU8jKQISGeey7iaHS8c3o389syVGn0wvy sIU5d5H/Xq2WMkhejdUTX6Bs= X-Received: by 127.0.0.2 with SMTP id dqIMYY1788612xhyzGm3vL4E; Thu, 26 Oct 2023 16:54:04 -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: 2MXy31Sk0fT5SQYGeIFCdcpjx1787277AA= 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-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698364445639100021 Content-Type: text/plain; charset="utf-8" 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); if (RedfishValue.Value.StringArray[Index] =3D=3D NULL) { ASSERT (FALSE); + FreePool (RedfishValue.Value.StringArray); return EFI_OUT_OF_RESOURCES; } =20 @@ -828,6 +829,12 @@ ApplyFeatureSettingsStringArrayType ( DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __fun= c__, Schema, Version, ConfigureLang)); } =20 + for (Index =3D 0; Index < RedfishValue.ArrayCount; Index++) { + FreePool (RedfishValue.Value.StringArray[Index]); + } + + FreePool (RedfishValue.Value.StringArray); + return Status; } =20 @@ -927,6 +934,8 @@ ApplyFeatureSettingsNumericArrayType ( DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __fun= c__, Schema, Version, ConfigureLang)); } =20 + FreePool (RedfishValue.Value.IntegerArray); + return Status; } =20 @@ -1026,6 +1035,8 @@ ApplyFeatureSettingsBooleanArrayType ( DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __fun= c__, Schema, Version, ConfigureLang)); } =20 + FreePool (RedfishValue.Value.BooleanArray); + return Status; } =20 --=20 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-