From: Michael Tremer Date: Mon, 18 May 2026 16:02:24 +0000 (+0000) Subject: main: Call zone_done() when the XFR could not be started X-Git-Tag: 0.0.1~19 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=a94ba5b30d578e488aae1a9fa6f725524214cd64;p=zone-sync.git main: Call zone_done() when the XFR could not be started Signed-off-by: Michael Tremer --- diff --git a/main.c b/main.c index d5baa5c..07506d7 100644 --- a/main.c +++ b/main.c @@ -264,6 +264,7 @@ static void transfer_done(dns_zone_t* zone, uint32_t* expireopt, isc_result_t re static int do_transfer(dns_zone_t* zone, uint32_t serial) { dns_xfrin_t* xfrin = NULL; dns_rdatatype_t xfrtype; + int r; // Try an incremental xfr if we have a serial if (serial) { @@ -283,7 +284,21 @@ static int do_transfer(dns_zone_t* zone, uint32_t serial) { DNS_TRANSPORT_NONE, ctx.transport, ctx.tlsctx_cache, ctx.memctx, &xfrin); // Start the transfer - return dns_xfrin_start(xfrin, transfer_done); + r = dns_xfrin_start(xfrin, transfer_done); + switch (r) { + case ISC_R_SUCCESS: + break; + + default: + ERROR("Failed to initialize zone transfer: %s\n", isc_result_totext(r)); + goto ERROR; + } + + return r; + +ERROR: + zone_done(zone); + return r; } static isc_result_t zone_loaded(void* data) {