From cd22fdc28d35e3a659c89f346ff5e36b64e44845 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Mon, 1 Aug 2022 16:45:41 +0200 Subject: [PATCH] - Fix #728: alloc_reg_obtain() core dump. Stop double alloc_reg_release when serviced_create fails. --- doc/Changelog | 2 ++ services/outside_network.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index e902e5db8..f457dfc4b 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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:'. diff --git a/services/outside_network.c b/services/outside_network.c index 3f479a3a3..b5b20cbb0 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -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( -- 2.47.3