Use g_malloc0 instead of g_malloc when allocating rspamd_re_cache_async_ctx
to ensure callback_processed flag is initialized to FALSE. Without this,
the flag could randomly be TRUE (from uninitialized memory), causing the
exists/save callbacks to be silently skipped and preventing re_class
compilation from proceeding after cache misses.
if (cbdata->state == RSPAMD_RE_CACHE_COMPILE_STATE_CHECK_EXISTS) {
/* Check via Lua backend (handles file, redis, http) */
- struct rspamd_re_cache_async_ctx *ctx = g_malloc(sizeof(*ctx));
+ struct rspamd_re_cache_async_ctx *ctx = g_malloc0(sizeof(*ctx));
ctx->cbdata = cbdata;
ctx->loop = loop;
ctx->w = w;
offset += iov[j].iov_len;
}
- struct rspamd_re_cache_async_ctx *ctx = g_malloc(sizeof(*ctx));
+ struct rspamd_re_cache_async_ctx *ctx = g_malloc0(sizeof(*ctx));
ctx->cbdata = cbdata;
ctx->loop = loop;
ctx->w = w;