]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #728: alloc_reg_obtain() core dump. Stop double
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 1 Aug 2022 14:45:41 +0000 (16:45 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 1 Aug 2022 14:45:41 +0000 (16:45 +0200)
  alloc_reg_release when serviced_create fails.

doc/Changelog
services/outside_network.c

index e902e5db82118bb80ba5aab79538d3d7d003d670..f457dfc4ba40bb089de417dab31b2cc0727060ca 100644 (file)
@@ -2,6 +2,8 @@
        - Fix the novel ghost domain issues CVE-2022-30698 and CVE-2022-30699.
        - Tests for ghost domain fixes.
        - Tag for 1.16.2 release. The code repo continues with 1.16.3.
+       - Fix #728: alloc_reg_obtain() core dump. Stop double
+         alloc_reg_release when serviced_create fails.
 
 19 July 2022: George
        - Update documentation for 'outbound-msg-retry:'.
index 3f479a3a36febba4522d38b9b8d842f411f5f865..b5b20cbb06cf0b4bc1dce6bdef255ca3f47a67e1 100644 (file)
@@ -2545,8 +2545,10 @@ serviced_create(struct outside_network* outnet, sldns_buffer* buff, int dnssec,
 #ifdef UNBOUND_DEBUG
        rbnode_type* ins;
 #endif
-       if(!sq) 
+       if(!sq) {
+               alloc_reg_release(alloc, region);
                return NULL;
+       }
        sq->node.key = sq;
        sq->alloc = alloc;
        sq->region = region;
@@ -3432,7 +3434,6 @@ outnet_serviced_query(struct outside_network* outnet,
                                infra_ratelimit_dec(env->infra_cache,
                                        zone, zonelen, timenow);
                        }
-                       alloc_reg_release(env->alloc, region);
                        return NULL;
                }
                if(!(cb = (struct service_callback*)regional_alloc(