Fix crash freeing negative SRV cache entries.

Thanks to Daniel for finding this one.
This commit is contained in:
Simon Kelley
2019-01-09 15:08:16 +00:00
parent 5b99eae59d
commit a90f09db4c

View File

@@ -200,7 +200,7 @@ static void cache_hash(struct crec *crecp)
static void cache_blockdata_free(struct crec *crecp) 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); blockdata_free(crecp->addr.srv.target);
#ifdef HAVE_DNSSEC #ifdef HAVE_DNSSEC
else if (crecp->flags & F_DNSKEY) else if (crecp->flags & F_DNSKEY)