2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

clean up some handle/client reference counting errors in error cases.

We weren't consistent about who should unreference the handle in
case of network error. Make it consistent so that it's always the
client code responsibility to unreference the handle - either
in the callback or right away if send function failed and the callback
will never be called.
This commit is contained in:
Witold Kręcicki
2020-01-17 11:42:35 +01:00
parent dcc0835a3a
commit 8d6dc8613a
4 changed files with 19 additions and 10 deletions

View File

@@ -470,8 +470,7 @@ isc__nm_tcpdns_send(isc_nmhandle_t *handle, isc_region_t *region,
REQUIRE(sock->type == isc_nm_tcpdnssocket);
if (sock->outer == NULL) {
/* The socket is closed, just issue the callback */
cb(handle, ISC_R_FAILURE, cbarg);
/* The socket is closed */
return (ISC_R_NOTCONNECTED);
}