]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] Fix memory leak in fuzzy storage khash tables
authorVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 28 Oct 2025 15:51:51 +0000 (15:51 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 28 Oct 2025 15:51:51 +0000 (15:51 +0000)
commitc693f721de9762ab0a82360e4c474f0d4b642007
tree78ac66a0746bfe1d98586d5ec79c18d2b850ba89
parent6bfa590be3d7d0794641e2e9c9c35715b7fdad98
[Fix] Fix memory leak in fuzzy storage khash tables

In init_fuzzy(), two khash tables were created but their destructors
were not added to the config mempool:
- ctx->default_forbidden_ids
- ctx->weak_ids

While these tables were destroyed in the worker cleanup code (before
exit), this cleanup doesn't run during configtest, causing a memory leak.

Fix: Add mempool destructors for both hash tables, similar to how
ctx->keys and ctx->errors_ips are handled. This ensures proper cleanup
in all scenarios including configtest.
src/fuzzy_storage.c