Subject: Re: [PATCH] ares_parse_txt_reply

Re: [PATCH] ares_parse_txt_reply

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 27 Oct 2009 19:26:06 +0100 (CET)

On Tue, 27 Oct 2009, Jakub Hrozek wrote:

> I tested that apart from simple records and multiple records per host, it
> also handles multiple substrings in the TXT record (used to make the whole
> string>255 bytes, configured as 'host IN TXT ( "Foo" "Bar" )' in Bind).
>
> Comments or reviews are mostly welcome!

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.

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...)

-- 
  / daniel.haxx.se
Received on 2009-10-27