From: Vsevolod Stakhov Date: Wed, 17 Dec 2014 17:03:11 +0000 (+0000) Subject: Allow to allocate shingles without pool. X-Git-Tag: 0.8.0~78^2~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=30e37db22654d400f2ac2f9d89e89678a7782131;p=rspamd.git Allow to allocate shingles without pool. --- diff --git a/src/libutil/shingles.c b/src/libutil/shingles.c index 287e5875d..2307a318c 100644 --- a/src/libutil/shingles.c +++ b/src/libutil/shingles.c @@ -54,7 +54,13 @@ rspamd_shingles_generate (GArray *input, gint i, j, beg = 0; gsize shalen; - res = rspamd_mempool_alloc (pool, sizeof (*res)); + if (pool != NULL) { + res = rspamd_mempool_alloc (pool, sizeof (*res)); + } + else { + res = g_malloc (sizeof (*res)); + } + cksum = g_checksum_new (G_CHECKSUM_SHA256); cur_key = key; out_key = (guchar *)&keys[0];