[PATCH] tools: ifwitool: fix memory leak in ibbp_dir_add()

Simon Glass sjg at chromium.org
Mon May 25 17:07:52 CEST 2026


Hi Anton,

On 2026-05-21T19:13:59, Anton Moryakov <ant.v.moryakov at gmail.com> wrote:
> tools: ifwitool: fix memory leak in ibbp_dir_add()
>
> Signed-off-by: Anton Moryakov <ant.v.moryakov at gmail.com>
>
> tools/ifwitool.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)

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

>
>     tools: ifwitool: fix memory leak in ibbp_dir_add()
>
>     Signed-off-by: Anton Moryakov <ant.v.moryakov at gmail.com>

Please can you add a commit body? Describe which buffers leak on which
path, and how you checked (static analysis, valgrind, etc). Something
like:

   On the error path from buffer_from_file() the manifest buffer
allocated above is never released. On the success path the manifest,
ibbl and ibb buffers are copied into the destination subpart buffer by
create_subpart() but never freed.

   Free them explicitly to plug the leak.

Regards,
Simon


More information about the U-Boot mailing list