diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-20 15:07:58 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-22 10:57:29 +0100 |
commit | eafdd221037b41ddcba0add79fd8efccecaf0775 (patch) | |
tree | e66add9878fad4934f952e422308d8a2f836fdb7 /src/libutil/map.c | |
parent | f5a7eddda980f8d6f2e0aaeca46ed4bd6f0f34b4 (diff) | |
download | rspamd-eafdd221037b41ddcba0add79fd8efccecaf0775.tar.gz rspamd-eafdd221037b41ddcba0add79fd8efccecaf0775.zip |
[Minor] Try to fix more issues
Diffstat (limited to 'src/libutil/map.c')
-rw-r--r-- | src/libutil/map.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c index 3ca94806f..eadf0279c 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -274,7 +274,12 @@ free_http_cbdata_common (struct http_callback_data *cbd, gboolean plan_new) MAP_RELEASE (cbd->bk, "rspamd_map_backend"); - MAP_RELEASE (periodic, "periodic"); + + if (periodic) { + /* Detached in case of HTTP error */ + MAP_RELEASE (periodic, "periodic"); + } + g_free (cbd); } @@ -325,7 +330,11 @@ http_map_error (struct rspamd_http_connection *conn, cbd->bk->uri, cbd->addr ? rspamd_inet_address_to_string_pretty (cbd->addr) : "", err); + MAP_RETAIN (cbd->periodic, "periodic"); rspamd_map_process_periodic (cbd->periodic); + MAP_RELEASE (cbd->periodic, "periodic"); + /* Detach periodic as rspamd_map_process_periodic will destroy it */ + cbd->periodic = NULL; MAP_RELEASE (cbd, "http_callback_data"); } @@ -2236,6 +2245,7 @@ rspamd_map_backend_dtor (struct rspamd_map_backend *bk) switch (bk->protocol) { case MAP_PROTO_FILE: if (bk->data.fd) { + ev_stat_stop (ev_default_loop (0), &bk->data.fd->st_ev); g_free (bk->data.fd->filename); g_free (bk->data.fd); } |