Subject: Re: Use of malloc/free in c-ares

Re: Use of malloc/free in c-ares

From: Daniel Stenberg <daniel_at_haxx.se>
Date: 2005-03-10

On Tue, 8 Mar 2005, codemastr wrote:

> DYN_LOCAL(char, tmp_buf, strlen(name)+1);
> strcpy(tmp_buf, name);
> hostent.h_name = tmp_buf;
> callback(arg, ARES_SUCCESS, &hostent);
> DYN_FREE(tmp_buf);
>
> Of course, due to the way DYN_LOCAL is defined, it needs to be treated as a
> variable definition and therefore must be at the beginning of a block. Other
> than that though, imho it is a pretty clean solution.

Given a nice set of comments where this is defined, I'm all for trying this
approach. If it would turn out really ugly one day, we can always revert later
on.

-- 
          -=- Daniel Stenberg -=- http://daniel.haxx.se -=-
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
_______________________________________________
http://cool.haxx.se/mailman/listinfo/c-ares
Received on Thu Mar 10 00:16:12 2005