diff --git a/lib/isc/netmgr/tlsdns.c b/lib/isc/netmgr/tlsdns.c index 0e79a110d1..d03bd69a8e 100644 --- a/lib/isc/netmgr/tlsdns.c +++ b/lib/isc/netmgr/tlsdns.c @@ -1079,13 +1079,13 @@ tls_write_cb(uv_write_t *req, int status) { free_senddata(sock); + isc__nm_uvreq_put(&uvreq, sock); + if (status != 0) { tls_error(sock, isc__nm_uverr2result(status)); return; } - isc__nm_uvreq_put(&uvreq, sock); - result = tls_cycle(sock); if (result != ISC_R_SUCCESS) { tls_error(sock, result);