[PATCH 1/3] bootstd: Fix memleak on errors in bootmeth_setup_iter_order()

Simon Glass sjg at chromium.org
Tue Jan 14 14:13:56 CET 2025


On Sat, 11 Jan 2025 at 20:42, Sam Protsenko <semen.protsenko at linaro.org> wrote:
>
> Free memory allocated for 'order' (array of bootmeths) on error paths in
> bootmeth_setup_iter_order() function.
>
> Fixes: c627cfc14c08 ("bootstd: Allow scanning for global bootmeths separately")
> Fixes: 10d16faa436c ("bootstd: Detect empty bootmeth")
> Signed-off-by: Sam Protsenko <semen.protsenko at linaro.org>
> ---
>  boot/bootmeth-uclass.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
>

Reviewed-by: Simon Glass <sjg at chromium.org>

How about adding a test to check there is no leak? You can see
test/lib/abuf.c for similar tests.


More information about the U-Boot mailing list