mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-31 20:09:35 -05:00
Merge pull request #399 from xiangbao227/master
I found that in function "lruhash_remove", table was locked at first ,then lru_remove the entry , then unlock the table, and then markdel entry , but in function "rrset_cache_touch" , the entry will be touched to lru again before markdelling entry in function "lruhash_remove". This may lead to core!
This commit is contained in:
commit
7e46204bf7
1 changed files with 2 additions and 2 deletions
|
|
@ -398,13 +398,13 @@ lruhash_remove(struct lruhash* table, hashvalue_type hash, void* key)
|
|||
return;
|
||||
}
|
||||
table->num--;
|
||||
table->space_used -= (*table->sizefunc)(entry->key, entry->data);
|
||||
lock_quick_unlock(&table->lock);
|
||||
table->space_used -= (*table->sizefunc)(entry->key, entry->data);
|
||||
lock_rw_wrlock(&entry->lock);
|
||||
if(table->markdelfunc)
|
||||
(*table->markdelfunc)(entry->key);
|
||||
lock_rw_unlock(&entry->lock);
|
||||
lock_quick_unlock(&bin->lock);
|
||||
lock_quick_unlock(&table->lock);
|
||||
/* finish removal */
|
||||
d = entry->data;
|
||||
(*table->delkeyfunc)(entry->key, table->cb_arg);
|
||||
|
|
|
|||
Loading…
Reference in a new issue