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>
This commit is contained in:
Mike Maslenkin 2023-08-30 00:30:15 +03:00 committed by mergify[bot]
parent d81813368a
commit a87e8505b1
1 changed files with 4 additions and 4 deletions

View File

@ -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) {
//