dnsmasq: backport latest patches
[openwrt/staging/lynxis.git] / package / network / services / dnsmasq / patches / 0025-Fix-crash-freeing-negative-SRV-cache-entries.patch
1 From a90f09db4cc635941a32b973b57e58c662569625 Mon Sep 17 00:00:00 2001
2 From: Simon Kelley <simon@thekelleys.org.uk>
3 Date: Wed, 9 Jan 2019 15:08:16 +0000
4 Subject: [PATCH 25/57] Fix crash freeing negative SRV cache entries.
5
6 Thanks to Daniel for finding this one.
7
8 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
9 ---
10 src/cache.c | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13 --- a/src/cache.c
14 +++ b/src/cache.c
15 @@ -200,7 +200,7 @@ static void cache_hash(struct crec *crec
16
17 static void cache_blockdata_free(struct crec *crecp)
18 {
19 - if (crecp->flags & F_SRV)
20 + if (crecp->flags & F_SRV && !(crecp->flags & F_NEG))
21 blockdata_free(crecp->addr.srv.target);
22 #ifdef HAVE_DNSSEC
23 else if (crecp->flags & F_DNSKEY)