From 1bc75522035142a986466b321eefa42bb7bdb47a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
Date: Wed, 19 Jan 2022 13:35:32 +0100
Subject: [PATCH] Ensure diff variable is not read uninitialized

Coverity detected issues:
- var_decl: Declaring variable "diff" without initializer.
- uninit_use_in_call: Using uninitialized value "diff.tuples.head" when
  calling "dns_diff_clear".

(cherry picked from commit 67e773c93c2fe164e3791e0b843f724a6d9358d4)
Conflict: NA
Reference: https://gitlab.isc.org/isc-projects/bind9/-/commit/1bc75522035142a986466b321eefa42bb7bdb47a
---
 lib/dns/zone.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/dns/zone.c b/lib/dns/zone.c
index 76f03683de..b7b02ae5f9 100644
--- a/lib/dns/zone.c
+++ b/lib/dns/zone.c
@@ -23328,7 +23328,7 @@ setserial(isc_task_t *task, isc_event_t *event) {
 	ENTER;
 
 	if (zone->update_disabled) {
-		goto failure;
+		goto disabled;
 	}
 
 	desired = sse->serial;
@@ -23407,6 +23407,8 @@ failure:
 		dns_db_detach(&db);
 	}
 	dns_diff_clear(&diff);
+
+disabled:
 	isc_event_free(&event);
 	dns_zone_idetach(&zone);
 
-- 
2.23.0

