From: Evan Hunt Date: Mon, 25 Jan 2021 21:14:14 +0000 (-0800) Subject: Remove reference count REQUIRE in isc_nm_read() X-Git-Tag: v9.17.19~15^2~13 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=d9e1ad9e37f7941dff0b19c18ea64cfd7d842467;p=thirdparty%2Fbind9.git Remove reference count REQUIRE in isc_nm_read() Previously isc_nm_read() required references on the handle to be at least 2, under the assumption that it would only ever be called from a connect or accept callback. however, it can also be called from a read callback, in which case the reference count might be only 1. --- diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 6f10061fcd9..c5f24e51506 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -2527,13 +2527,6 @@ void isc_nm_read(isc_nmhandle_t *handle, isc_nm_recv_cb_t cb, void *cbarg) { REQUIRE(VALID_NMHANDLE(handle)); - /* - * This is always called via callback (from accept or connect), and - * caller must attach to the handle, so the references always need to be - * at least 2. - */ - REQUIRE(isc_refcount_current(&handle->references) >= 2); - switch (handle->sock->type) { case isc_nm_udpsocket: isc__nm_udp_read(handle, cb, cbarg);