[ldns-users] [PATCH] Fix memory leak in ldns_dname2buffer_wire_compress

Max Liebkies mail at maxliebkies.de
Fri Sep 5 16:19:56 UTC 2014


Hi,

to keep up with Johannes' post from yesterday, here's another patch to
fix a memory leak in ldns. 

In host2wire.c:ldns_dname2buffer_wire_compress() label and rest are both
created by memcpy'ing the data contained in name, via ldns_dname_label()
and ldns_dname_left_chop() respectively. On return (or recursion) they
get freed but not deep freed. This leaves the data contained therein
laying around. 

I tested the patch and it seems to fix the issue, altough I'm not 100%
sure I understood the recursive nature of the function correctly. ;-)

Cheers,
Max
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-memory-leak-in-ldns_dname2buffer_wire_compress.patch
Type: text/x-patch
Size: 977 bytes
Desc: 0001-Fix-memory-leak-in-ldns_dname2buffer_wire_compress.patch
URL: <http://lists.nlnetlabs.nl/pipermail/ldns-users/attachments/20140905/74bc037a/attachment.bin>


More information about the ldns-users mailing list