2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-28 21:17:54 +00:00

Add missing acquire memory barrier in isc_nmhandle_unref

The ThreadSanitizer uses system synchronization primitives to check for
data race.  The netmgr handle->references was missing acquire memory
barrier before resetting and reusing the memory occupied by isc_nmhandle_t.
This commit is contained in:
Ondřej Surý 2020-06-11 13:01:26 +02:00
parent 50d3344ca5
commit 1013c0930e

View File

@ -1156,6 +1156,8 @@ isc_nmhandle_unref(isc_nmhandle_t *handle) {
if (isc_refcount_decrement(&handle->references) > 1) {
return;
}
/* We need an acquire memory barrier here */
(void)isc_refcount_current(&handle->references);
sock = handle->sock;
handle->sock = NULL;