no modification of critical regions outside of lock region.
git-svn-id: file:///svn/unbound/trunk@4497
be551aaa-1e26-0410-a405-
d3ace91eadb9
- Fix unfreed locks in log and arc4random at exit of unbound.
- unit test with valgrind
- Fix lock race condition in dns cache dname synthesis.
+ - lock subnet new item before insertion to please checklocks,
+ no modification of critical regions outside of lock region.
1 February 2018: Wouter
- fix unaligned structure making a false positive in checklock
return;
}
lru_entry = &mrep_entry->entry;
+ lock_rw_wrlock(&lru_entry->lock);
lru_entry->data = calloc(1,
sizeof(struct subnet_msg_cache_data));
if (!lru_entry->data) {
if (acquired_lock) {
lock_rw_unlock(&lru_entry->lock);
} else {
+ lock_rw_unlock(&lru_entry->lock);
slabhash_insert(subnet_msg_cache, h, lru_entry, lru_entry->data,
NULL);
}