diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-02-12 15:40:26 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-02-12 15:57:33 +0000 |
commit | b358d2f752fb3b559bacda0e7c3c3dc68933e277 (patch) | |
tree | 444bf7f40d1f1f7e58c7146f563764c0d46b0cc4 /src/libstat | |
parent | c23f9a17f6b60b3eee4f4cc51bddc6ec11b0092b (diff) | |
download | rspamd-b358d2f752fb3b559bacda0e7c3c3dc68933e277.tar.gz rspamd-b358d2f752fb3b559bacda0e7c3c3dc68933e277.zip |
[Fix] Fix learn errors propagation
Diffstat (limited to 'src/libstat')
-rw-r--r-- | src/libstat/backends/redis_backend.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index 2f4baf3b8..6e0201db9 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -988,11 +988,6 @@ rspamd_redis_fin (gpointer data) /* This calls for all callbacks pending */ redisAsyncFree (redis); } - - if (rt->err) { - g_error_free (rt->err); - rt->err = NULL; - } } static void @@ -1013,11 +1008,6 @@ rspamd_redis_fin_learn (gpointer data) /* This calls for all callbacks pending */ redisAsyncFree (redis); } - - if (rt->err) { - g_error_free (rt->err); - rt->err = NULL; - } } static void @@ -1490,6 +1480,8 @@ rspamd_redis_runtime (struct rspamd_task *task, } rt = rspamd_mempool_alloc0 (task->task_pool, sizeof (*rt)); + rspamd_mempool_add_destructor (task->task_pool, + rspamd_gerror_free_maybe, &rt->err); rspamd_redis_expand_object (ctx->redis_object, ctx, task, &rt->redis_object_expanded); rt->selected = up; @@ -1617,9 +1609,6 @@ rspamd_redis_finalize_process (struct rspamd_task *task, gpointer runtime, } if (rt->err) { - g_error_free (rt->err); - rt->err = NULL; - return FALSE; } |