diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-03-10 18:25:09 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-03-10 18:25:09 +0300 |
commit | eda90216086cafa5c84f7a13f4d5bf72d4e225bd (patch) | |
tree | 84c75e0eda4dfa26209ab71d93165b19b6307283 /src/mem_pool.c | |
parent | aa959154787b080cdfa5efe09e5c927381d095a2 (diff) | |
download | rspamd-eda90216086cafa5c84f7a13f4d5bf72d4e225bd.tar.gz rspamd-eda90216086cafa5c84f7a13f4d5bf72d4e225bd.zip |
Fix race in surbl module.
Add more debugging to destructors in pools.
Diffstat (limited to 'src/mem_pool.c')
-rw-r--r-- | src/mem_pool.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mem_pool.c b/src/mem_pool.c index 38e45e662..161da4f01 100644 --- a/src/mem_pool.c +++ b/src/mem_pool.c @@ -438,7 +438,8 @@ memory_pool_unlock_shared (memory_pool_t * pool, void *pointer) } void -memory_pool_add_destructor (memory_pool_t * pool, pool_destruct_func func, void *data) +memory_pool_add_destructor_full (memory_pool_t * pool, pool_destruct_func func, void *data, + const gchar *function, const gchar *line) { struct _pool_destructors *cur, *tmp; @@ -449,6 +450,8 @@ memory_pool_add_destructor (memory_pool_t * pool, pool_destruct_func func, void while (tmp) { if (tmp->func == func && tmp->data == data) { /* Do not add identical destructors, they must be unique */ + msg_warn ("duplicate desctrutors detected: already have destructor from %s:%s and is trying to add from %s:%s", + tmp->function, tmp->loc, function, line); return; } tmp = tmp->prev; @@ -456,6 +459,8 @@ memory_pool_add_destructor (memory_pool_t * pool, pool_destruct_func func, void cur->func = func; cur->data = data; + cur->function = function; + cur->loc = line; cur->prev = pool->destructors; pool->destructors = cur; } |