]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #1017: memory corruption related core dumps.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 14 Apr 2026 13:34:59 +0000 (15:34 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 14 Apr 2026 13:34:59 +0000 (15:34 +0200)
  When alloc_reg_obtain has an empty list, return a new allocation.

doc/Changelog
util/alloc.c

index 9e38cc51537c9e43fc0035815af6265f43648c1f..761e2a4f6906b1b5cfa7625583d6d74b30e23970 100644 (file)
@@ -1,3 +1,7 @@
+14 April 2026: Wouter
+       - Fix #1017: memory corruption related core dumps.
+         When alloc_reg_obtain has an empty list, return a new allocation.
+
 13 April 2026: Yorgos
        - Update the documentation of 'max-query-restarts' in the man page.
 
index 9a99246f589c2aee62c7b88c8e82f7d994f8b3ed..e4e1aeb4dcba963e148678d3abed45356b45e088 100644 (file)
@@ -328,7 +328,7 @@ size_t alloc_get_mem(struct alloc_cache* alloc)
 struct regional* 
 alloc_reg_obtain(struct alloc_cache* alloc)
 {
-       if(alloc->num_reg_blocks > 0) {
+       if(alloc->num_reg_blocks > 0 && alloc->reg_list) {
                struct regional* r = alloc->reg_list;
                alloc->reg_list = (struct regional*)r->next;
                r->next = NULL;