mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 05:28:00 +00:00
Add missing isc_refcount_destroy() for isc__nmsocket_t
The destructor for the isc__nmsocket_t was missing call to the isc_refcount_destroy() on the reference counter, which might lead to spurious ThreadSanitizer data race warnings if we ever change the acquire-release memory order in the isc_refcount_decrement().
This commit is contained in:
parent
9b8d432403
commit
b1026dd4c1
@ -665,6 +665,8 @@ nmsocket_cleanup(isc_nmsocket_t *sock, bool dofree FLARG) {
|
|||||||
"\n",
|
"\n",
|
||||||
sock, isc_refcount_current(&sock->references));
|
sock, isc_refcount_current(&sock->references));
|
||||||
|
|
||||||
|
isc_refcount_destroy(&sock->references);
|
||||||
|
|
||||||
isc__nm_decstats(sock, STATID_ACTIVE);
|
isc__nm_decstats(sock, STATID_ACTIVE);
|
||||||
|
|
||||||
atomic_store(&sock->destroying, true);
|
atomic_store(&sock->destroying, true);
|
||||||
@ -675,7 +677,9 @@ nmsocket_cleanup(isc_nmsocket_t *sock, bool dofree FLARG) {
|
|||||||
* so we can clean up and free the children.
|
* so we can clean up and free the children.
|
||||||
*/
|
*/
|
||||||
for (size_t i = 0; i < sock->nchildren; i++) {
|
for (size_t i = 0; i < sock->nchildren; i++) {
|
||||||
if (!atomic_load(&sock->children[i].destroying)) {
|
REQUIRE(!atomic_load(&sock->children[i].destroying));
|
||||||
|
if (isc_refcount_decrement(
|
||||||
|
&sock->children[i].references)) {
|
||||||
nmsocket_cleanup(&sock->children[i],
|
nmsocket_cleanup(&sock->children[i],
|
||||||
false FLARG_PASS);
|
false FLARG_PASS);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user