[ldns-users] memleak in ldns_rr_list_subtype_by_rdf

Marius Rieder marius.rieder at durchmesser.ch
Mon Jun 29 10:31:11 UTC 2009


Hi

ldns_rr_list_subtype_by_rdf return NULL if no rr has matched, but don't
free the created ldns_rr_list *subtyped;
It's just "24 bytes in 1 blocks." but buged me because my program was
losing memory.

Marius

--- rr.c.orig	2009-06-28 21:48:25.000000000 +0200
+++ rr.c	2009-06-29 12:26:23.000000000 +0200
@@ -948,6 +947,7 @@
 	if (ldns_rr_list_rr_count(subtyped) > 0) {
 		return subtyped;
 	} else {
+		ldns_rr_list_free(subtyped);
 		return NULL;
 	}
 }

-- 
   ~o__O                 Marius Rieder                  O__o~
    |vV|           http://www.durchmesser.ch/           |vV|
   /]  |         <marius.rieder at durchmesser.ch>         |  [\
---/|--|\--------[ Dance first.  Think later. ]--------/|--|\---



More information about the ldns-users mailing list