From 65235657f18dfaaa02652a17131b2f112a738883 Mon Sep 17 00:00:00 2001 From: gilles Date: Fri, 24 Jun 2016 18:14:41 +0200 Subject: setup iobuf / io in transaction allocator, otherwise if a reset happens before DATA, we'll release an uninitialized state and abort --- extras/filters/filter-rspamd/rspamd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extras/filters/filter-rspamd/rspamd.c b/extras/filters/filter-rspamd/rspamd.c index 53a1e5d..23901d7 100644 --- a/extras/filters/filter-rspamd/rspamd.c +++ b/extras/filters/filter-rspamd/rspamd.c @@ -61,6 +61,9 @@ transaction_allocator(uint64_t id) tx = xcalloc(1, sizeof *tx, "transaction_allocator"); tx->id = id; + iobuf_xinit(&tx->iobuf, LINE_MAX, LINE_MAX, "on_eom"); + io_init(&tx->io, -1, tx, rspamd_io, &tx->iobuf); + return tx; } @@ -128,8 +131,6 @@ rspamd_resolve(const char *h, const char *p) int rspamd_connect(struct transaction *tx) { - iobuf_xinit(&tx->iobuf, LINE_MAX, LINE_MAX, "on_eom"); - io_init(&tx->io, -1, tx, rspamd_io, &tx->iobuf); if (io_connect(&tx->io, (struct sockaddr *)&ss, NULL) == -1) return 0; return 1; -- cgit v1.2.3-59-g8ed1b