diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-26 13:57:28 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-26 13:57:28 +0000 |
commit | 9216b42e39225e28c20e452a1c389929ba8ba7b8 (patch) | |
tree | 02bfb1a2339c1d1fe2a5e815a753792e3bde1065 /src/libstat | |
parent | 023ba544e2e953cda439ea4e4e3d2cbaa3daae86 (diff) | |
download | rspamd-9216b42e39225e28c20e452a1c389929ba8ba7b8.tar.gz rspamd-9216b42e39225e28c20e452a1c389929ba8ba7b8.zip |
Try to fix memory leak on redis stat
Issue: #500
Reported by: @mozzan
Diffstat (limited to 'src/libstat')
-rw-r--r-- | src/libstat/backends/redis_backend.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index 808959d73..a4c62e426 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -1311,6 +1311,13 @@ rspamd_redis_get_stat (gpointer runtime, if (rt->ctx->stat_elt) { st = rt->ctx->stat_elt->ud; + if (rt->redis) { + event_del (&rt->timeout_event); + redisAsyncFree (rt->redis); + + rt->conn_state = RSPAMD_REDIS_DISCONNECTED; + } + if (st->stat) { return ucl_object_ref (st->stat); } |