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:
parent
50d3344ca5
commit
1013c0930e
@ -1156,6 +1156,8 @@ isc_nmhandle_unref(isc_nmhandle_t *handle) {
|
|||||||
if (isc_refcount_decrement(&handle->references) > 1) {
|
if (isc_refcount_decrement(&handle->references) > 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/* We need an acquire memory barrier here */
|
||||||
|
(void)isc_refcount_current(&handle->references);
|
||||||
|
|
||||||
sock = handle->sock;
|
sock = handle->sock;
|
||||||
handle->sock = NULL;
|
handle->sock = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user