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 D9900AC1B53 for ; Fri, 29 Sep 2023 21:59:28 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=hksa2Kiy4U98MXyhDTU9yLuxPvJgNMMpW4/3Ag08lfU=; 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=1696024767; v=1; b=k3qKvBdZNog2KUXDIo9eaofDhiZYH30LCIKxfZ+yg2ldZaUvzePKkdGIo5Zl1/xYkr9Twz48 dAW1dhjWms72XsXvV5IsON6170nft9z63P4okhIrxkt2NT5oIqnvMOJP8UqnViEGgQYYTP0OCRo dXUsaScYmNGCMLFwzHQLGyLA= X-Received: by 127.0.0.2 with SMTP id nvo4YY7687511xgmSWRTjGG0; Fri, 29 Sep 2023 14:59:27 -0700 X-Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.groups.io with SMTP id smtpd.web11.30211.1696024766680086208 for ; Fri, 29 Sep 2023 14:59:26 -0700 X-Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-32329d935d4so9318818f8f.2 for ; Fri, 29 Sep 2023 14:59:26 -0700 (PDT) X-Gm-Message-State: 3xWW9n0gjGGwCvMzfNG9AmTix7686176AA= X-Google-Smtp-Source: AGHT+IHprW53UEL5BiiUKqn9jal9UKNQ/O+nrAgWbXemq29HyQfU5GquX/8bYxOMD5HXdZxzoDP0nw== X-Received: by 2002:a5d:5602:0:b0:323:33b1:dc44 with SMTP id l2-20020a5d5602000000b0032333b1dc44mr4792583wrv.0.1696024764578; Fri, 29 Sep 2023 14:59:24 -0700 (PDT) X-Received: from localhost.localdomain ([185.9.78.108]) by smtp.gmail.com with ESMTPSA id y24-20020a2ebb98000000b002bfe8537f37sm890178lje.33.2023.09.29.14.59.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 29 Sep 2023 14:59:24 -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] [PATCH 6/9] RedfishClientPkg: fix memory leaks while applying feature settings Date: Sat, 30 Sep 2023 00:59:12 +0300 Message-Id: <20230929215915.46616-7-mike.maslenkin@gmail.com> In-Reply-To: <20230929215915.46616-1-mike.maslenkin@gmail.com> References: <20230929215915.46616-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=k3qKvBdZ; 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 (#109222): https://edk2.groups.io/g/devel/message/109222 Mute This Topic: https://groups.io/mt/101667465/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-