From f83b658d1eece21bc704bde04fc00fcfba88847f Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 25 Jun 2014 02:09:02 +0100 Subject: [PATCH] fix use after free Signed-off-by: John Crispin --- cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache.c b/cache.c index adfc815..150fb26 100644 --- a/cache.c +++ b/cache.c @@ -300,8 +300,8 @@ cache_answer(struct interface *iface, uint8_t *base, int blen, char *name, struc r = cache_record_find(name, a->type, port, dlen, rdata); if (r) { if (!a->ttl) { - cache_record_free(r); DBG(1, "D -> %s %s ttl:%d\n", dns_type_string(r->type), r->record, r->ttl); + cache_record_free(r); } else { r->ttl = a->ttl; DBG(1, "A -> %s %s ttl:%d\n", dns_type_string(r->type), r->record, r->ttl); -- 2.25.1