[ldns-users] [Patch] Memory leak in ldns_pkt_rr_list_by_name()
Willem Toorop
willem at nlnetlabs.nl
Fri Sep 5 09:15:19 UTC 2014
A clear bug. Patch applied. Thanks!
Op 04-09-14 om 20:42 schreef Johannes Naab:
> Hi,
>
> ldns_pkt_rr_list_by_name() is as found by valgrind leaking memory by
> first copying the necessary sections and never freeing the resulting
> list.
>
> ldns_pkt_rr_list_by_type() and ldns_pkt_rr_list_by_name_and_type() do
> properly free the intermediate copy.
>
> The patch fixes the problem the same way as ldns_pkt_rr_list_by_type()
> and ldns_pkt_rr_list_by_name_and_type() are dealing with it.
>
>
> An alternative approach avoiding some ldns_rr_clone() calls would be to
> free all non-matching RR already in the for loop and using only
> ldns_rr_list_free() at the end.
>
>
> Regards,
> Johannes
>
>
>
> _______________________________________________
> ldns-users mailing list
> ldns-users at open.nlnetlabs.nl
> http://open.nlnetlabs.nl/mailman/listinfo/ldns-users
>
More information about the ldns-users
mailing list