diff options
-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; } |