Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some gcc malloc leak analyzer workarounds.
gcc's leak checker simply cannot believe that this code does not leak the allocation for data, either (bizarrely) on every iteration of the loop that fills it or when generate_cert_list() returns, even though the trace it gives you stops right before the call to free() I've worked around this with the following pragma: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" ... #pragma GCC diagnostic pop ... only to discover that -flto makes the pragma not apply properly. This also introduces two build environment variables, ENABLE_LEAK_CHECKER and ENABLE_LEAK_CHECKER_LTO. Setting ENABLE_LEAK_CHECKER during the build will turn on the leak checker and disable -flto. If ENABLE_LEAK_CHECKER_LTO is also set, it won't disable -flto. *sigh*. Signed-off-by: Peter Jones <[email protected]>
- Loading branch information