On 06/02/2025 00:29, Anton Moryakov wrote:
report:
Dynamic memory, referenced by 'return value of xasprintf(...)',
is allocated at xfuncs_printf.c:344 by calling function 'xasprintf' at
bootchartd.c:318 and lost at bootchartd.c:320.

This happens in finalize(), which is called just before the process exits. There are no subsequent allocations, which means this should be controlled by the FEATURE_CLEAN_UP option, and not freed in normal builds:

config FEATURE_CLEAN_UP
        bool "Clean up all memory before exiting (usually not needed)"
        default n
        help
        As a size optimization, busybox normally exits without explicitly
        freeing dynamically allocated memory or closing files. This saves
space since the OS will clean up for us, but it can confuse debuggers
        like valgrind, which report tons of memory and resource leaks.

        Don't enable this unless you have a really good reason to clean
        things up manually.

Cheers,
Harald van Dijk
_______________________________________________
busybox mailing list
[email protected]
https://lists.busybox.net/mailman/listinfo/busybox

Reply via email to