public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Mike Maslenkin" <mike.maslenkin@gmail.com>
To: devel@edk2.groups.io
Cc: Mike Maslenkin <mike.maslenkin@gmail.com>,
	Abner Chang <abner.chang@amd.com>,
	Nickle Wang <nicklew@nvidia.com>,
	Igor Kulchytskyy <igork@ami.com>
Subject: [edk2-devel] [edk2-redfish-client][PATCH v2 3/4] RedfishClientPkg/Bios: fix leak of GetPendingSettings URI.
Date: Wed, 21 Feb 2024 23:06:27 +0300	[thread overview]
Message-ID: <20240221200628.74174-4-mike.maslenkin@gmail.com> (raw)
In-Reply-To: <20240221200628.74174-1-mike.maslenkin@gmail.com>

Cc: Abner Chang <abner.chang@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
---
 .../Features/Bios/v1_0_9/Dxe/BiosDxe.c          | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index db77ed3dfccb..a442d446bc35 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -132,12 +132,13 @@ RedfishResourceConsumeResource (
   // Check and see if "@Redfish.Settings" exist or not.
   //
   ZeroMem (&PendingSettingResponse, sizeof (REDFISH_RESPONSE));
-  Status = GetPendingSettings (
-             Private->RedfishService,
-             Response.Payload,
-             &PendingSettingResponse,
-             &PendingSettingUri
-             );
+  PendingSettingUri = NULL;
+  Status            = GetPendingSettings (
+                        Private->RedfishService,
+                        Response.Payload,
+                        &PendingSettingResponse,
+                        &PendingSettingUri
+                        );
   if (!EFI_ERROR (Status)) {
     DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", __func__, PendingSettingUri));
     Private->Uri     = PendingSettingUri;
@@ -206,6 +207,10 @@ RedfishResourceConsumeResource (
     FreePool (Etag);
   }
 
+  if (PendingSettingUri != NULL) {
+    FreePool (PendingSettingUri);
+  }
+
   return Status;
 }
 
-- 
2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115737): https://edk2.groups.io/g/devel/message/115737
Mute This Topic: https://groups.io/mt/104495960/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  parent reply	other threads:[~2024-02-21 20:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21 20:06 [edk2-devel] [edk2-redfish-client][PATCH v2 0/4] RedfishClientPkg: fix memory leaks and refine code Mike Maslenkin
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 1/4] RedfishClientPkg/RedfishFeatureUtilityLib: fix memory leak on error path Mike Maslenkin
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback Mike Maslenkin
2024-02-22  2:14   ` Nickle Wang via groups.io
     [not found]   ` <17B60D9667B989F2.14827@groups.io>
2024-02-23  9:38     ` Nickle Wang via groups.io
2024-02-23 11:31       ` Mike Maslenkin
2024-02-23 13:34         ` Nickle Wang via groups.io
2024-02-21 20:06 ` Mike Maslenkin [this message]
2024-02-21 20:06 ` [edk2-devel] [edk2-redfish-client][PATCH v2 4/4] RedfishClientPkg: use Json value from a function argument Mike Maslenkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240221200628.74174-4-mike.maslenkin@gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox