]> source.dussan.org Git - rspamd.git/commitdiff
Fix access to already freed memory.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 4 Aug 2011 16:41:05 +0000 (20:41 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 4 Aug 2011 16:41:05 +0000 (20:41 +0400)
Remove assert.

src/mem_pool.c
src/protocol.c

index 252fa54f9697ff4efac2b1f396bac87baa2d1f86..d5b3ddf6e6738af92de11fb66f99b40b15e03632 100644 (file)
@@ -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;
index 84eb050c1a8609881bad29c8bff04256e7cc4552..4e15a47d84c147fcb64c66cd748d6a665535ba99 100644 (file)
@@ -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,