Skip to content

CI: add a sanitizer build job (ASan, UBSan, LSan) and fix IMAP parser leaks - #364

Merged
vincent-richard merged 2 commits into
masterfrom
ci-sanitizers-and-imap-leak-fixes
Oct 22, 2026
Merged

vincent-richard merged 2 commits into
masterfrom
ci-sanitizers-and-imap-leak-fixes

Conversation

@vincent-richard

Copy link
Copy Markdown
Member

No description provided.

Build the library and tests with -fsanitize=address,undefined, and make
UndefinedBehaviorSanitizer errors fatal, so that memory errors, leaks
and undefined behaviour reached by the test suite fail the build.

Leaks in third-party libraries are suppressed in tests/lsan.supp.
IMAPParser::get() allocated the component, and only freed it if parsing
returned false. If parsing threw instead (eg. when reading a literal
from the socket failed), the component and all the partially parsed
components above it were leaked. Hold it in a std::unique_ptr until
parsing succeeds.

Also fix the IMAPParser tests which did not free the parsed responses.
@vincent-richard
vincent-richard merged commit 8620607 into master Oct 22, 2026
8 checks passed
@vincent-richard
vincent-richard deleted the ci-sanitizers-and-imap-leak-fixes branch October 22, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant