From: Vsevolod Stakhov Date: Thu, 4 Aug 2011 16:41:05 +0000 (+0400) Subject: Fix access to already freed memory. X-Git-Tag: 0.4.2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=028adcf6764fd816ad69a516e7873005ad4bee24;p=thirdparty%2Frspamd.git Fix access to already freed memory. Remove assert. --- diff --git a/src/mem_pool.c b/src/mem_pool.c index 252fa54f96..d5b3ddf6e6 100644 --- a/src/mem_pool.c +++ b/src/mem_pool.c @@ -231,7 +231,6 @@ memory_pool_alloc (memory_pool_t * pool, gsize size) } tmp = align_ptr (cur->pos, MEM_ALIGNMENT); cur->pos = tmp + size; - g_assert (cur->pos - cur->begin <= (gint)cur->len); return tmp; } return NULL; diff --git a/src/protocol.c b/src/protocol.c index 84eb050c1a..4e15a47d84 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -815,6 +815,7 @@ metric_symbols_callback_rspamc (gpointer key, gpointer value, void *user_data) if (cd->task->cmd == CMD_SYMBOLS) { if (! rspamd_dispatcher_write (task->dispatcher, outbuf, r, FALSE, FALSE)) { cd->alive = FALSE; + return; } } cd->report_offset += rspamd_snprintf (cd->report_buf + cd->report_offset, cd->report_size - cd->report_offset,