diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-09-24 13:03:30 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-09-24 13:03:30 +0100 |
commit | 8916bc1b2d2d6e7a12a38b572d5bad8972650080 (patch) | |
tree | d4dfac920c39c3ccb7af1e1fcea443b24472d556 /src | |
parent | d9b7d2be2d84b27faf113f180162988faa319e86 (diff) | |
download | rspamd-8916bc1b2d2d6e7a12a38b572d5bad8972650080.tar.gz rspamd-8916bc1b2d2d6e7a12a38b572d5bad8972650080.zip |
Revert "[Minor] Try to fix refcounts related crash"
This reverts commit 5bae837e5fb282e055a9d80d9d6aaf7eaed9a2d5.
Diffstat (limited to 'src')
-rw-r--r-- | src/lua/lua_tcp.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c index 952ea06ba..70e959690 100644 --- a/src/lua/lua_tcp.c +++ b/src/lua/lua_tcp.c @@ -599,6 +599,7 @@ lua_tcp_push_error (struct lua_tcp_cbdata *cbd, gboolean is_fatal, } lua_settop (L, top); + TCP_RELEASE (cbd); callback_called = TRUE; @@ -623,6 +624,7 @@ lua_tcp_push_error (struct lua_tcp_cbdata *cbd, gboolean is_fatal, } va_end (ap); + lua_thread_pool_restore_callback (&cbs); } @@ -1366,7 +1368,6 @@ lua_tcp_dns_handler (struct rdns_reply *reply, gpointer ud) const struct rdns_request_name *rn; if (reply->code != RDNS_RC_NOERROR) { - TCP_RETAIN (cbd); rn = rdns_request_get_name (reply->request, NULL); lua_tcp_push_error (cbd, TRUE, "unable to resolve host: %s", rn->name); @@ -1391,7 +1392,6 @@ lua_tcp_dns_handler (struct rdns_reply *reply, gpointer ud) rspamd_inet_address_set_port (cbd->addr, cbd->port); if (!lua_tcp_make_connection (cbd)) { - TCP_RETAIN (cbd); lua_tcp_push_error (cbd, TRUE, "unable to make connection to the host %s", rspamd_inet_address_to_string (cbd->addr)); TCP_RELEASE (cbd); @@ -2069,7 +2069,6 @@ lua_tcp_connect_sync (lua_State *L) if (!rspamd_dns_resolver_request_task (task, lua_tcp_dns_handler, cbd, RDNS_REQUEST_A, host)) { - cbd->item = NULL; /* We have not registered watcher */ lua_pushboolean (L, FALSE); lua_pushliteral (L, "Failed to initiate dns request"); TCP_RELEASE (cbd); |