bootm_get_devicetree() returns a buffer the caller has to free, and
efi_install_fdt() copies it into EFI memory. Free it once installed.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johannes Schneider <[email protected]>
---
 efi/loader/bootm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/efi/loader/bootm.c b/efi/loader/bootm.c
index a68db742e1..425e61fd70 100644
--- a/efi/loader/bootm.c
+++ b/efi/loader/bootm.c
@@ -245,7 +245,9 @@ static int efi_loader_bootm(struct image_data *data)
                goto out;
        }
        if (fdt) {
+               /* efi_install_fdt() installs a copy */
                ret = efi_install_fdt(fdt);
+               free(fdt);
                if (ret)
                        goto out;
        }
-- 
2.43.0


Reply via email to