From a90f09db4cc635941a32b973b57e58c662569625 Mon Sep 17 00:00:00 2001
From: Simon Kelley <simon@thekelleys.org.uk>
Date: Wed, 9 Jan 2019 15:08:16 +0000
Subject: [PATCH 25/30] Fix crash freeing negative SRV cache entries.

Thanks to Daniel for finding this one.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
---
 src/cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/src/cache.c
+++ b/src/cache.c
@@ -200,7 +200,7 @@ static void cache_hash(struct crec *crec
 
 static void cache_blockdata_free(struct crec *crecp)
 {
-  if (crecp->flags & F_SRV)
+  if (crecp->flags & F_SRV && !(crecp->flags & F_NEG))
     blockdata_free(crecp->addr.srv.target);
 #ifdef HAVE_DNSSEC
   else if (crecp->flags & F_DNSKEY)
