summaryrefslogtreecommitdiffstats
path: root/RedfishPkg
diff options
context:
space:
mode:
authorMike Maslenkin <mike.maslenkin@gmail.com>2023-08-30 00:30:15 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-12-27 00:09:49 +0000
commita87e8505b1509fb00bc586b7e00c884487c4298d (patch)
treefabef9a71b5a8aecad649de4b2b17d519e13e909 /RedfishPkg
parentd81813368a66c1b27f58ecc68e75d1bc850a3e96 (diff)
downloadedk2-a87e8505b1509fb00bc586b7e00c884487c4298d.tar.gz
edk2-a87e8505b1509fb00bc586b7e00c884487c4298d.tar.bz2
edk2-a87e8505b1509fb00bc586b7e00c884487c4298d.zip
RedfishPkg: RedfishDiscoverDxe: fix memory leak on error path.
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>
Diffstat (limited to 'RedfishPkg')
-rw-r--r--RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
index 06d8d00da7..e344e06d8d 100644
--- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
+++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
@@ -829,6 +829,10 @@ AddAndSignalNewRedfishService (
} while (TRUE);
}
+ if (Char16Uuid != NULL) {
+ FreePool (Char16Uuid);
+ }
+
if (NewFound || InfoRefresh) {
if (!InfoRefresh) {
DiscoveredList = (EFI_REDFISH_DISCOVERED_INTERNAL_LIST *)AllocateZeroPool (sizeof (EFI_REDFISH_DISCOVERED_INTERNAL_LIST));
@@ -907,10 +911,6 @@ AddAndSignalNewRedfishService (
}
}
- if (Char16Uuid != NULL) {
- FreePool ((VOID *)Char16Uuid);
- }
-
Status = EFI_SUCCESS;
if (NewFound || InfoRefresh) {
//