[edk2-devel] [PATCH 3/5] RedfishClientPkg: fix leak of allocated Etag data

Mike Maslenkin posted 5 patches 2 years, 5 months ago
There is a newer version of this series
[edk2-devel] [PATCH 3/5] RedfishClientPkg: fix leak of allocated Etag data
Posted by Mike Maslenkin 2 years, 5 months ago
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
 RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c            | 3 +++
 .../Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c     | 3 +++
 RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c        | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index f5562fb49cab..b27f1de77660 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -220,6 +220,9 @@ RedfishResourceConsumeResource (
     Private->Json = NULL;
   }
 
+  if (Etag != NULL) {
+    FreePool (Etag);
+  }
   return Status;
 }
 
diff --git a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
index 91968dbe488f..c5a168a06a98 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
@@ -164,6 +164,9 @@ RedfishResourceConsumeResource (
     Private->Json = NULL;
   }
 
+  if (Etag != NULL) {
+    FreePool (Etag);
+  }
   return Status;
 }
 
diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
index c55a6848c74e..91fdb85d3e08 100644
--- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
+++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
@@ -164,6 +164,9 @@ RedfishResourceConsumeResource (
     Private->Json = NULL;
   }
 
+  if (Etag != NULL) {
+    FreePool (Etag);
+  }
   return Status;
 }
 
-- 
2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108046): https://edk2.groups.io/g/devel/message/108046
Mute This Topic: https://groups.io/mt/100988473/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-