From 03165efaa67359fdcabb6206ed02cba36498be5a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 30 Sep 2016 12:12:17 +0100 Subject: [Minor] Try to fix some memory inconsistencies --- contrib/lc-btrie/btrie.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'contrib/lc-btrie') diff --git a/contrib/lc-btrie/btrie.c b/contrib/lc-btrie/btrie.c index d95bf0676..51357a1d6 100644 --- a/contrib/lc-btrie/btrie.c +++ b/contrib/lc-btrie/btrie.c @@ -1380,9 +1380,10 @@ btrie_init(rspamd_mempool_t *mp) { struct btrie *btrie; - if (!(btrie = rspamd_mempool_alloc (mp, sizeof(*btrie)))) + if (!(btrie = rspamd_mempool_alloc0 (mp, sizeof(*btrie)))) { return NULL; - memset(btrie, 0, sizeof(*btrie)); + } + btrie->mp = mp; btrie->alloc_total = sizeof(*btrie); -- cgit v1.2.3