From f367e50b63f46e6221409d88ffb6d29109d7a6c9 Mon Sep 17 00:00:00 2001
From: Daniel Salzman <daniel.salzman@nic.cz>
Date: Tue, 1 Apr 2014 09:24:18 +0200
Subject: [PATCH] xfr: fix possible memory leak (Coverity)

---
 src/knot/updates/xfr-in.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/knot/updates/xfr-in.c b/src/knot/updates/xfr-in.c
index 8b9b6b469b..d46e92ea5c 100644
--- a/src/knot/updates/xfr-in.c
+++ b/src/knot/updates/xfr-in.c
@@ -253,6 +253,7 @@ int xfrin_process_axfr_packet(knot_pkt_t *pkt, knot_ns_xfr_t *xfr, knot_zone_con
 	if (*zone == NULL) {
 		// Transfer start, init zone
 		if (rr->type != KNOT_RRTYPE_SOA) {
+			knot_rrset_free(&rr, NULL);
 			return KNOT_EMALF;
 		}
 		*zone = knot_zone_contents_new(rr->owner);
-- 
GitLab