Skip to content

Commit 5baa68d

Browse files
author
yueyuankun
committed
fallback: fix memory leak in find_boot_csv()
In find_boot_csv(), bootcsv and bootarchcsv are allocated by StrDuplicate() but were not being freed before the function returns, causing a memory leak.
1 parent c4665d2 commit 5baa68d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

fallback.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,12 @@ find_boot_csv(EFI_FILE_HANDLE fh, CHAR16 *dirname,
825825
dirname, bootarchcsv, efi_status);
826826
}
827827
}
828+
829+
if (bootcsv)
830+
FreePool(bootcsv);
831+
if (bootarchcsv)
832+
FreePool(bootarchcsv);
833+
828834
return EFI_SUCCESS;
829835
}
830836

0 commit comments

Comments
 (0)