]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Free the rr list in ldns_pkt_rr(). Ray Bellis reported.
authorWouter Wijngaards <wouter@NLnetLabs.nl>
Fri, 16 Jan 2009 15:24:32 +0000 (15:24 +0000)
committerWouter Wijngaards <wouter@NLnetLabs.nl>
Fri, 16 Jan 2009 15:24:32 +0000 (15:24 +0000)
Not a deep_free, right, Jelte?

packet.c

index cc0ff0abef2e54365f5aee712a70ec24b8367ef3..5f4ccce1fb12956130ca62ffdc15f32a863af4f7 100644 (file)
--- a/packet.c
+++ b/packet.c
@@ -363,9 +363,11 @@ ldns_pkt_rr(ldns_pkt *pkt, ldns_pkt_section sec, ldns_rr *rr)
        for(i = 0; i < rr_count; i++) {
                if (ldns_rr_compare(ldns_rr_list_rr(rrs, i), rr) == 0) {
                        /* a match */
+                       ldns_rr_list_free(rrs);
                        return true;
                }
        }
+       ldns_rr_list_free(rrs);
        return false;
 }