Re: Do I need to free() after gethostbyname()?
Re: Do I need to free() after gethostbyname()?
- Subject: Re: Do I need to free() after gethostbyname()?
- From: Justin Walker <email@hidden>
- Date: Wed, 29 Sep 2004 11:44:14 -0700
On Sep 29, 2004, at 10:35, Dave Camp wrote:
I've got some leaks in my program and ObjectAlloc seems to show a leak
for every call to gethostbyname().
The man page for gethostbyname doesn't indicate I need to free the
pointer that is returned and a google on 'gethostbyname free' yields
some hits that indicate that on some systems the pointer is to a
static struct and does not need to be freed, and on others it is
malloc'd and does need to be freed
According to the man page, the values returned point to static storage.
On the other hand, the code (in the libinfo project) appears to show
dynamically allocated storage. I didn't follow all the twisty little
passages, so am just guessing about this.
In any case, a bug report might be in order (at least, for the man
page).
Regards,
Justin
--
Justin C. Walker, Curmudgeon-At-Large *
Institute for General Semantics | When LuteFisk is outlawed
| Only outlaws will have
| LuteFisk
*--------------------------------------*-------------------------------*
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden