bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] Memory leak in idn_encode; Valgrind suppression file


From: Ander Juaristi
Subject: Re: [Bug-wget] Memory leak in idn_encode; Valgrind suppression file
Date: Mon, 06 Apr 2015 17:24:13 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 04/06/2015 12:57 PM, Hubert Tarasiuk wrote:
The problem was, that `remote_to_utf8` would allocate a new buffer, but
the buffer was never freed.
(It was the `new` pointer, later copied to `host`, used for
`idna_to_ascii_8z`. After returning from idn_encode, it was out of scope.)
I'm not pretending to cast down your patches, I'm sure you did a thorough 
research, probably using Valgrind.
But just being pedantic, the reason of the leak is not because *new becomes out 
of scope, since idn_encode()
is only called at url_parse(), and the *new pointer returned by the former is 
catched by the latter and stored in
u->host, which is in the end freed at url_free() (kinda looks like, at a glance 
:D).

And since the first part (`tests`) fails, `make check`
does not even make it to the second part (`testenv`). (Which is probably
another bug, not a feature :D.)
Probably ;-D

Regards,

- AJ



reply via email to

[Prev in Thread] Current Thread [Next in Thread]