Files
threadx/common_modules/module_manager
Frédéric Desbiens bd8d30f23b Fixed code_buffer leak in the module converter utilities (#581)
The host-side module converter utilities allocated code_buffer inside the
loop over the ELF code sections and never released it, so every code
section in the input ELF leaked one buffer. The malloc() result was also
unchecked, so a failed allocation passed a null pointer on to
elf_object_read() and crashed the tool.

Release the buffer at the end of each iteration and report a clean failure
with exit code 5 when the allocation does not succeed. Verified with
AddressSanitizer on a two-code-section input: 128 bytes leaked in 2
allocations before, none after, with byte-identical output.

Fixes https://github.com/eclipse-threadx/threadx/issues/571

Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
2026-08-08 08:01:38 -04:00
..