]> git.ipfire.org Git - zone-sync.git/commitdiff
main: Re-use the same cleanup handler on error
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 11 May 2026 14:17:19 +0000 (14:17 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 11 May 2026 14:17:19 +0000 (14:17 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
main.c

diff --git a/main.c b/main.c
index 187ffc8121a6c0d204f98c396cb5184635a86573..157e4f6e76f1a52c9820128b3c22de7eb8e11862 100644 (file)
--- a/main.c
+++ b/main.c
@@ -258,8 +258,8 @@ static isc_result_t zone_loaded(void* data) {
        return do_transfer(zone, serial);
 
 ERROR:
-       // Free the zone
-       dns_zone_detach(&zone);
+       // Destroy the zone
+       zone_done(zone);
 
        return r;
 }
@@ -341,9 +341,7 @@ static void do_zone(const char* name) {
 
 ERROR:
        // Destroy the zone
-       dns_zone_detach(&zone);
-
-       return;
+       zone_done(zone);
 }
 
 static void run_loop(void* data) {