diff options
author | Mike Maslenkin <mike.maslenkin@gmail.com> | 2023-08-30 00:30:15 +0300 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-12-27 00:09:49 +0000 |
commit | a87e8505b1509fb00bc586b7e00c884487c4298d (patch) | |
tree | fabef9a71b5a8aecad649de4b2b17d519e13e909 /RedfishPkg | |
parent | d81813368a66c1b27f58ecc68e75d1bc850a3e96 (diff) | |
download | edk2-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.c | 8 |
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) {
//
|