Subject: Re: [PATCH] ares_parse_txt_reply

Re: [PATCH] ares_parse_txt_reply

From: Jakub Hrozek <jhrozek_at_redhat.com>
Date: Wed, 28 Oct 2009 22:06:04 +0100

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/27/2009 07:26 PM, Daniel Stenberg wrote:
> I gave it a quick glance just now and I spotted two things:
>
> 1) 'struct txt_reply' is a global struct and should thus be with ares_
> prefix
> like ares_txt_reply or similar.
>

Renamed. I should probably rename 'struct srv_reply' to 'struct
ares_srv_reply' in a followup patch as well..?

> 2) in the loop I spotted a malloc() that does break on a NULL return, but
> there's no free()ing done on previous successful malloc()s and thus this
> function risks leaking memory. (I realize it is an edge case, but
> still...)
>

Yes, that is a bug. I think the best solution might be to provide a free
function and use it both internally in cases like this and provide it
externally.

Thank you for the review. A new patch is attached.

        Jakub
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkrosi0ACgkQHsardTLnvCVO9QCg6KplNxROwRye5HMozh0MOyOp
Oh0AnRX7FtiQjuSVvnQ13QzBZp1p0VZK
=xxSW
-----END PGP SIGNATURE-----

Received on 2009-10-28