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 BAE84AC010A for ; Wed, 10 Apr 2024 01:47:50 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=vdrpOedwGYJqjheCZTwNvJEd1zOqp95P2txoQHVP7nA=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1712713669; v=1; b=WVgnNrnt1PTCQSdT8vV2oDUl9nK17A740lRmwDBalDnXbfcJX3QvjeHIo7wxfCjiUVX13MRS zC94w4LO4waIt/maqVAjHtnPIqw35TQbn5gVkm8r63wNqGo7W6Q6BSQvQN4fSh5+xWUV97xD3Di SEFi9SgS83G5wXPbY9525+WF4JrpZgbgWS9jIXcxORCW7jfe6MV3Cm3BBQJ7cfDVaVYcmdHUaaK hp8p9IE56+KrwaCncYsiF93NAW+iOIW1QAgO5dcDIvwvO7/O7cHs0c0SnQkXQExaCOtnXZiACRG 64rh2NkbCtQwU4dZVHCHKdn6L9slstuQCd9eyACj9v1qg== X-Received: by 127.0.0.2 with SMTP id rAakYY7687511xumalrVfH4U; Tue, 09 Apr 2024 18:47:49 -0700 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.94]) by mx.groups.io with SMTP id smtpd.web10.155302.1712713668621044439 for ; Tue, 09 Apr 2024 18:47:48 -0700 X-Received: from LV8PR12MB9452.namprd12.prod.outlook.com (2603:10b6:408:200::8) by CH3PR12MB8260.namprd12.prod.outlook.com (2603:10b6:610:12a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Wed, 10 Apr 2024 01:47:43 +0000 X-Received: from LV8PR12MB9452.namprd12.prod.outlook.com ([fe80::e006:4173:de2c:aca0]) by LV8PR12MB9452.namprd12.prod.outlook.com ([fe80::e006:4173:de2c:aca0%5]) with mapi id 15.20.7409.042; Wed, 10 Apr 2024 01:47:43 +0000 From: "Chang, Abner via groups.io" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy , Nick Ramirez Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/2] RedfishClientPkg/Features: release resources Thread-Topic: [edk2-redfish-client][PATCH v2 2/2] RedfishClientPkg/Features: release resources Thread-Index: AQHahD9z5QS3TRg63ESNK0wJNQLi5bFgyZfA Date: Wed, 10 Apr 2024 01:47:43 +0000 Message-ID: References: <20240401141757.38594-1-nicklew@nvidia.com> In-Reply-To: <20240401141757.38594-1-nicklew@nvidia.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=62edeb13-64fe-40ec-aa72-357b972051ca;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2024-04-10T01:47:28Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV8PR12MB9452:EE_|CH3PR12MB8260:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: jJ53IXJcAelpBXcu2HiKz0Im0HfXVmCVOmVYXMbyge8LmiwlGLQ7jBFmdGn2sM7Cbb9ajWS33akgw+bqsH5V//K8kTHPm6p//VOSi/345dfIoXJq3SM+QoQd+AyBwVlwXhnonexQ4ssTxWuo9Synw4s1uPkTTO61YCYwPUrZ7wQNinoUu3qRW/25wR7jaXxXWBMC6kMkDhfP79XZOhE2aJ79PkRH4I+F0dY78QiEMYhzv0FACeO0qayEUoTXSlVidcDpr/NKYTDZ2DQcj0E8YmmT57p/ZcGLQDKyyMZKPapJIlzxXrpacXnpRbBuhd13QAwf4i0pS3Br8kyZaJdF8ABGyJuOskEzuTRs4u2yJNoRXmUq1cSPpGIZGd4N5gdHE7fjrWNv1IyPJaExYmA3/qvtWdYGCq5ZmceEn3gPSAsC8Ox6OPrrlJF+/oUAMN6lFAdCIKoEApencrCxgPhQ8EljY/628NS1K3cYUhY1fnotsAeg64vyiPqkgtDtnC+2aaRNYglSJ6raja6UUALbxs2hOSRXN0eOXYvfnu+bT8IgORgrN8NVYRxX+zR4i2WHRywcFhaZdH3L4wtCztYGHEherKLtnkTbkXRIEgzCyLEbKQSfR2u0tBO8rFuS9+KVPoSq/BmQ3wr0zEtHtn2/efae3Kq7dWGqxLI1gW2cbgc= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?brM2bEA98ImaqLtAZbC6moecNQXkL2I6ACD9ZBadXSGkNdtK1332WuqKWWTp?= =?us-ascii?Q?ZZmd8Of3a8uoxD88RQQZeSJMm7xoLPOSrU9mE8peWKWUGqFMiqYTjfn78xM8?= =?us-ascii?Q?3tErzdJg8EyYcwcD4/HRFGCmR9k4RAq9TKfdj3cGJ1brsdoHNDOxR/WqMc/w?= =?us-ascii?Q?6uCu2KS6Be+AbORfHJksuLknVVXacAYZuW4qb1fWlH8M5MjvdumotwSx+EZN?= =?us-ascii?Q?kjDbqcovGxk1aVNz2CX/Mv23ZqHWcxphGyVhSCrBXMs+xycve7ORr2KoFwF7?= =?us-ascii?Q?4r/34FaIZyD6Q4uQ2RVRCo/SLCu2nvXjYYM39kU+DW0fceLTcccPC+uHljzy?= =?us-ascii?Q?iFu4dz48FmmUBQn4BOpwaywtgFSFdx98f+uWh5P6P+gno5pUoyB/ZQyocrZw?= =?us-ascii?Q?DjqtAn995ugwxfC7KB8xi6YhzlQsESmNACQMrTapg0AwS1x1IvzIRuwCHprS?= =?us-ascii?Q?f8tiRC6zxk23YciEfhhvclD5XmrhcnE5pfjhi0LIExiH6gT7a9D4XTFiH41j?= =?us-ascii?Q?5EGN8+Ix/psl1Iw5Fb5Mg1icSvH6Xf38ykvGJB+YjPtpOMuLJcuDyJGSWkj/?= =?us-ascii?Q?n+Edr4yFRj24jvrUKg6jrbXQgDroxvyJ6I2dwtgCVkbs+Eu0WSfi7w0ohFYi?= =?us-ascii?Q?JUBxFrF85ToKqp/y+AolijIWGDhd2RsZaVbnFsLNgkZUL5YbQl8W1nvTTpxN?= =?us-ascii?Q?KFIFLq3rK8TjYgcQLWVvyagmQGL/1hZ8vDRuMLLCwrNP5oKaEgB8cd8saDy5?= =?us-ascii?Q?f5HL8iYD8GqOJ9RvQRkFzemOJT54PyaU7i7mQJ05/XZm5Ix3xpeHwdubNzZl?= =?us-ascii?Q?lChB5TalqsBKx7crqf5Od2lOByyYBssiqio2F3qGZoNCHfzinB8HXjIj5HPs?= =?us-ascii?Q?jRt859AN4+6nav8gtQEDK5en1CC97uaQho7N7DwwrEqlAWiFkpFhee7feRiu?= =?us-ascii?Q?+7sZc5YUd3TV9Itw1xs2M2ZdJF8P8TSY5U0du5Ps+YhvjCZKh1UTKXW1Plih?= =?us-ascii?Q?NdQuhipvniMypmF7+K8gUVX+P8Dtkg1nD+s+dEd0enE5vpOzVfI+xPcO0zCe?= =?us-ascii?Q?y3EALAu9vRdyE0nEHUmLGYyvmK5d2hDNkqkWf9v/mvSuLzZFcx5firuBx4Qc?= =?us-ascii?Q?17dJ/8ZWNLT8H+D0vAvmjpJVYRrqyizgB7VGfARvBEsph/oAKa6VWyMf9BBw?= =?us-ascii?Q?FD29dak09BxiqzMUq2s4S2um3RgrlF74jwtXXZROkgpsb5kpUCCmQpmBdnsb?= =?us-ascii?Q?DurQoZNNWhrEoFIuzHz5vpeFENv5p31fUCvFk5Z4ZOHSmx5kn6hz1PcZHBxY?= =?us-ascii?Q?Kt24ZK6g9EGEzl5w01FYSvJaLpV5faeFkE0dO0na4Ef29jXc3FAwryQoSz7g?= =?us-ascii?Q?JRcKjUIE2y5vGgShSwrrVbXhVLytDEXXn/KIN4Ea+2+tzFW8H9ugNzF8QxZ+?= =?us-ascii?Q?GNBwrTgOIkn6GXDlDdPiS4dZaL5/S6vH6JfbvOw3xpxGraL5pIaL+KKzvdFO?= =?us-ascii?Q?4UEBfjS5CULKVxA1/qNG03mV6ksGJjm8WZoEdNzp0e2opFVFzz6y9JzV/x3U?= =?us-ascii?Q?iTtbywFsXqcuRA8/my8=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV8PR12MB9452.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 004c387f-44c9-401c-1a1e-08dc590036a0 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2024 01:47:43.0779 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0QDEb9usrp5MdA1YEHEs1rAtV7LAjSDRV1q5uha+Yxoflkwb13URJ+nadM/+inQzIg/QjTyd+PC8G2Ncxbf8ZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8260 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 Resent-Date: Tue, 09 Apr 2024 18:47:48 -0700 Resent-From: abner.chang@amd.com Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: JuosngiIROnQIKeUSOMaH0Ydx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=WVgnNrnt; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io [AMD Official Use Only - General] Reviewed-by: Abner Chang > -----Original Message----- > From: Nickle Wang > Sent: Monday, April 1, 2024 10:18 PM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Igor Kulchytskyy > ; Nick Ramirez > Subject: [edk2-redfish-client][PATCH v2 2/2] RedfishClientPkg/Features: r= elease > resources > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > -Release Etag and PendingSettingUri resources. > -Update function header for GetHttpResponseEtag() and > GetHttpResponseLocation(). Caller has to release returned > memory buffer from these two functions. > -Fix typo. > > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > Cc: Nick Ramirez > --- > .../Features/Bios/v1_0_9/Common/BiosCommon.c | 2 +- > .../Features/Bios/v1_0_9/Dxe/BiosDxe.c | 20 ++++++++-- > .../BootOption/v1_0_4/Dxe/BootOptionDxe.c | 33 ++++++++++++----- > .../BootOptionCollectionDxe.c | 2 +- > .../v1_13_0/Dxe/ComputerSystemDxe.c | 33 ++++++++++++----- > .../v1_5_0/Dxe/ComputerSystemDxe.c | 33 ++++++++++++----- > .../ComputerSystemCollectionDxe.c | 2 +- > .../Features/Memory/V1_7_1/Dxe/MemoryDxe.c | 37 ++++++++++++++----- > .../MemoryCollectionDxe/MemoryCollectionDxe.c | 2 +- > .../RedfishFeatureUtilityLib.c | 2 + > 10 files changed, 118 insertions(+), 48 deletions(-) > > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c > b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c > index f40fe215a..5dc97876c 100644 > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c > @@ -815,7 +815,7 @@ HandleResource ( > > // > // Check and see if target property exist or not even when collection = member > exists. > - // If not, we sill do provision. > + // If not, we still do provision. > // > DEBUG ((REDFISH_DEBUG_TRACE, "%a Check for %s\n", __func__, Uri)); > Status =3D EdkIIRedfishResourceConfigCheck (&SchemaInfo, Uri, NULL); > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > index bb64ef862..5955917f2 100644 > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > @@ -158,8 +158,12 @@ RedfishResourceConsumeResource ( > // > // Searching for etag in HTTP response header > // > - Etag =3D NULL; > - GetHttpResponseEtag (ExpectedResponse, &Etag); > + Etag =3D NULL; > + Status =3D GetHttpResponseEtag (ExpectedResponse, &Etag); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, failed to get ETag from HTTP header\n", > __func__)); > + } > + > Status =3D RedfishConsumeResourceCommon (Private, Private->Json, Etag)= ; > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a: failed to consume resource from: %s: %r\n"= , > __func__, Private->Uri, Status)); > @@ -338,8 +342,12 @@ RedfishResourceCheck ( > // > // Find etag in HTTP response header > // > - Etag =3D NULL; > - GetHttpResponseEtag (&Response, &Etag); > + Etag =3D NULL; > + Status =3D GetHttpResponseEtag (&Response, &Etag); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, failed to get ETag from HTTP header\n", > __func__)); > + } > + > Status =3D RedfishCheckResourceCommon (Private, Private->Json, Etag); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, failed to check resource from: %s: %r\n", > __func__, Uri, Status)); > @@ -348,6 +356,10 @@ RedfishResourceCheck ( > // > // Release resource > // > + if (Etag !=3D NULL) { > + FreePool (Etag); > + } > + > RedfishHttpFreeResponse (&Response); > Private->Payload =3D NULL; > > diff --git a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDx= e.c > b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c > index 5a66fe59e..1a1262403 100644 > --- a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c > +++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c > @@ -122,12 +122,13 @@ RedfishResourceConsumeResource ( > // > // Check and see if "@Redfish.Settings" exist or not. > // > - Status =3D GetPendingSettings ( > - Private->RedfishService, > - Response.Payload, > - &PendingSettingResponse, > - &PendingSettingUri > - ); > + PendingSettingUri =3D NULL; > + Status =3D GetPendingSettings ( > + Private->RedfishService, > + Response.Payload, > + &PendingSettingResponse, > + &PendingSettingUri > + ); > if (!EFI_ERROR (Status)) { > DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: @Redfish.Settings > found: %s\n", __func__, PendingSettingUri)); > SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri); > @@ -147,8 +148,12 @@ RedfishResourceConsumeResource ( > // > // Find etag in HTTP response header > // > - Etag =3D NULL; > - GetHttpResponseEtag (ExpectedResponse, &Etag); > + Etag =3D NULL; > + Status =3D GetHttpResponseEtag (ExpectedResponse, &Etag); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n", > __func__)); > + } > + > Status =3D RedfishConsumeResourceCommon (Private, Private->Json, Etag)= ; > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a: failed to consume resource from: %s: %r\n"= , > __func__, Private->Uri, Status)); > @@ -170,6 +175,10 @@ RedfishResourceConsumeResource ( > Private->Json =3D NULL; > } > > + if (PendingSettingUri !=3D NULL) { > + FreePool (PendingSettingUri); > + } > + > return Status; > } > > @@ -323,8 +332,12 @@ RedfishResourceCheck ( > // > // Find etag in HTTP response header > // > - Etag =3D NULL; > - GetHttpResponseEtag (&Response, &Etag); > + Etag =3D NULL; > + Status =3D GetHttpResponseEtag (&Response, &Etag); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n", > __func__)); > + } > + > Status =3D RedfishCheckResourceCommon (Private, Private->Json, Etag); > if (EFI_ERROR (Status)) { > DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: failed to check > resource from: %s: %r\n", __func__, Uri, Status)); > diff --git > a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.= c > b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.= c > index cd1437f54..79ec739cb 100644 > --- > a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.= c > +++ > b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.= c > @@ -85,7 +85,7 @@ HandleResource ( > > // > // Check and see if target property exist or not even when collection = member > exists. > - // If not, we sill do provision. > + // If not, we still do provision. > // > DEBUG ((REDFISH_BOOT_OPTION_COLLECTION_DEBUG_TRACE, "%a Check > for %s\n", __func__, Uri)); > Status =3D EdkIIRedfishResourceConfigCheck (&SchemaInfo, Uri, NULL); > diff --git > a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD > xe.c > b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD > xe.c > index a0c71212b..9c405bb2f 100644 > --- > a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD > xe.c > +++ > b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD > xe.c > @@ -125,12 +125,13 @@ RedfishResourceConsumeResource ( > // Check and see if "@Redfish.Settings" exist or not. > // > ZeroMem (&PendingSettingResponse, sizeof (REDFISH_RESPONSE)); > - Status =3D GetPendingSettings ( > - Private->RedfishService, > - Response.Payload, > - &PendingSettingResponse, > - &PendingSettingUri > - ); > + PendingSettingUri =3D NULL; > + Status =3D GetPendingSettings ( > + Private->RedfishService, > + Response.Payload, > + &PendingSettingResponse, > + &PendingSettingUri > + ); > if (!EFI_ERROR (Status)) { > DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", > __func__, PendingSettingUri)); > SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri); > @@ -151,8 +152,12 @@ RedfishResourceConsumeResource ( > // > // Find etag in HTTP response header > // > - Etag =3D NULL; > - GetHttpResponseEtag (ExpectedResponse, &Etag); > + Etag =3D NULL; > + Status =3D GetHttpResponseEtag (ExpectedResponse, &Etag); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n", > __func__)); > + } > + > Status =3D RedfishConsumeResourceCommon (Private, Private->Json, Etag)= ; > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a: failed to consume resource from: %s: %r\n"= , > __func__, Private->Uri, Status)); > @@ -177,6 +182,10 @@ RedfishResourceConsumeResource ( > Private->Json =3D NULL; > } > > + if (PendingSettingUri !=3D NULL) { > + FreePool (PendingSettingUri); > + } > + > return Status; > } > > @@ -330,8 +339,12 @@ RedfishResourceCheck ( > // > // Find etag in HTTP response header > // > - Etag =3D NULL; > - GetHttpResponseEtag (&Response, &Etag); > + Etag =3D NULL; > + Status =3D GetHttpResponseEtag (&Response, &Etag); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n", > __func__)); > + } > + > Status =3D RedfishCheckResourceCommon (Private, Private->Json, Etag); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a: failed to check resource from: %s: %r\n", > __func__, Uri, Status)); > diff --git > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx > e.c > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx > e.c > index 494bf59df..a58151f67 100644 > --- > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx > e.c > +++ > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx > e.c > @@ -126,12 +126,13 @@ RedfishResourceConsumeResource ( > // Check and see if "@Redfish.Settings" exist or not. > // > ZeroMem (&PendingSettingResponse, sizeof (REDFISH_RESPONSE)); > - Status =3D GetPendingSettings ( > - Private->RedfishService, > - Response.Payload, > - &PendingSettingResponse, > - &PendingSettingUri > - ); > + PendingSettingUri =3D NULL; > + Status =3D GetPendingSettings ( > + Private->RedfishService, > + Response.Payload, > + &PendingSettingResponse, > + &PendingSettingUri > + ); > if (!EFI_ERROR (Status)) { > DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", > __func__, PendingSettingUri)); > SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri); > @@ -152,8 +153,12 @@ RedfishResourceConsumeResource ( > // > // Find etag in HTTP response header > // > - Etag =3D NULL; > - GetHttpResponseEtag (ExpectedResponse, &Etag); > + Etag =3D NULL; > + Status =3D GetHttpResponseEtag (ExpectedResponse, &Etag); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n", > __func__)); > + } > + > Status =3D RedfishConsumeResourceCommon (Private, Private->Json, Etag)= ; > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a: failed to consume resource from: %s: %r\n"= , > __func__, Private->Uri, Status)); > @@ -178,6 +183,10 @@ RedfishResourceConsumeResource ( > Private->Json =3D NULL; > } > > + if (PendingSettingUri !=3D NULL) { > + FreePool (PendingSettingUri); > + } > + > return Status; > } > > @@ -331,8 +340,12 @@ RedfishResourceCheck ( > // > // Find etag in HTTP response header > // > - Etag =3D NULL; > - GetHttpResponseEtag (&Response, &Etag); > + Etag =3D NULL; > + Status =3D GetHttpResponseEtag (&Response, &Etag); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n", > __func__)); > + } > + > Status =3D RedfishCheckResourceCommon (Private, Private->Json, Etag); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a: failed to check resource from: %s: %r\n", > __func__, Uri, Status)); > diff --git > a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemC > ollectionDxe.c > b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemC > ollectionDxe.c > index 3deefa824..868bacf02 100644 > --- > a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemC > ollectionDxe.c > +++ > b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemC > ollectionDxe.c > @@ -91,7 +91,7 @@ HandleResource ( > > // > // Check and see if target property exist or not even when collection = member > exists. > - // If not, we sill do provision. > + // If not, we still do provision. > // > DEBUG ((REDFISH_DEBUG_TRACE, "%a Check for %s\n", __func__, Uri)); > Status =3D EdkIIRedfishResourceConfigCheck (&SchemaInfo, Uri, NULL); > diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c > b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c > index f2c0a7735..87ce62c2d 100644 > --- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c > +++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c > @@ -126,12 +126,13 @@ RedfishResourceConsumeResource ( > // Check and see if "@Redfish.Settings" exist or not. > // > ZeroMem (&PendingSettingResponse, sizeof (REDFISH_RESPONSE)); > - Status =3D GetPendingSettings ( > - Private->RedfishService, > - Response.Payload, > - &PendingSettingResponse, > - &PendingSettingUri > - ); > + PendingSettingUri =3D NULL; > + Status =3D GetPendingSettings ( > + Private->RedfishService, > + Response.Payload, > + &PendingSettingResponse, > + &PendingSettingUri > + ); > if (!EFI_ERROR (Status)) { > DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", > __func__, PendingSettingUri)); > SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri); > @@ -151,8 +152,12 @@ RedfishResourceConsumeResource ( > // > // Find etag in HTTP response header > // > - Etag =3D NULL; > - GetHttpResponseEtag (ExpectedResponse, &Etag); > + Etag =3D NULL; > + Status =3D GetHttpResponseEtag (ExpectedResponse, &Etag); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n", > __func__)); > + } > + > Status =3D RedfishConsumeResourceCommon (Private, Private->Json, Etag)= ; > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a: failed to consume resource from: %s: %r\n"= , > __func__, Private->Uri, Status)); > @@ -174,6 +179,10 @@ RedfishResourceConsumeResource ( > FreePool (Etag); > } > > + if (PendingSettingUri !=3D NULL) { > + FreePool (PendingSettingUri); > + } > + > return Status; > } > > @@ -327,8 +336,12 @@ RedfishResourceCheck ( > // > // Find etag in HTTP response header > // > - Etag =3D NULL; > - GetHttpResponseEtag (&Response, &Etag); > + Etag =3D NULL; > + Status =3D GetHttpResponseEtag (&Response, &Etag); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n", > __func__)); > + } > + > Status =3D RedfishCheckResourceCommon (Private, Private->Json, Etag); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, failed to check resource from: %s: %r\n", > __func__, Uri, Status)); > @@ -337,6 +350,10 @@ RedfishResourceCheck ( > // > // Release resource > // > + if (Etag !=3D NULL) { > + FreePool (Etag); > + } > + > RedfishHttpFreeResponse (&Response); > Private->Payload =3D NULL; > > diff --git > a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c > b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c > index 38f28f902..6bf7f6fc5 100644 > --- a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c > +++ > b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c > @@ -87,7 +87,7 @@ HandleResource ( > > // > // Check and see if target property exist or not even when collection = member > exists. > - // If not, we sill do provision. > + // If not, we still do provision. > // > DEBUG ((REDFISH_DEBUG_TRACE, "%a Check for %s\n", __func__, Uri)); > Status =3D EdkIIRedfishResourceConfigCheck (&SchemaInfo, Uri, NULL); > diff --git > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib.c > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib.c > index 2cc079783..2add55921 100644 > --- > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib.c > +++ > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib.c > @@ -1744,6 +1744,7 @@ RedfishFeatureGetUnifiedArrayTypeConfigureLang ( > > /** > Find "ETag" from either HTTP header or Redfish response. > + It's caller's responsibility to release Etag by calling FreePool(). > > @param[in] Response HTTP response > @param[out] Etag String buffer to return ETag > @@ -1814,6 +1815,7 @@ GetHttpResponseEtag ( > > /** > Find "Location" from either HTTP header or Redfish response. > + It's caller's responsibility to release Location by calling FreePool()= . > > @param[in] Response HTTP response > @param[out] Location String buffer to return Location > -- > 2.34.1 -=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 (#117561): https://edk2.groups.io/g/devel/message/117561 Mute This Topic: https://groups.io/mt/105265012/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-