mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-01-09 08:12:54 -05:00
- Fix for #1032, add safeguard to make table space positive.
This commit is contained in:
parent
eb3e1ae24f
commit
3ea078baf6
2 changed files with 4 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
- Fix name of unit test for subnet cache response.
|
||||
- Fix #1032: The size of subnet_msg_cache calculation mistake cause
|
||||
memory usage increased beyond expectations.
|
||||
- Fix for #1032, add safeguard to make table space positive.
|
||||
|
||||
25 March 2024: Yorgos
|
||||
- Merge #831 from Pierre4012: Improve Windows NSIS installer
|
||||
|
|
|
|||
|
|
@ -543,7 +543,9 @@ lruhash_update_space_used(struct lruhash* table, void* cb_arg, int diff_size)
|
|||
/* find bin */
|
||||
lock_quick_lock(&table->lock);
|
||||
|
||||
table->space_used = (size_t)((int)table->space_used + diff_size);
|
||||
if((int)table->space_used + diff_size < 0)
|
||||
table->space_used = 0;
|
||||
else table->space_used = (size_t)((int)table->space_used + diff_size);
|
||||
|
||||
if(table->space_used > table->space_max)
|
||||
reclaim_space(table, &reclaimlist);
|
||||
|
|
|
|||
Loading…
Reference in a new issue