Hi all !

I've got a user-space question for you :

(This is sort of embarassing to ask, but a friend borrowed my SYSV book
 and the glibc info is of little use...)

I have this program that looks up IP addresses of hosts based on their names in
DNS.   I use gethostbyname().

gethostbyname() returns a pointer to a  struct hostent  so far so good. But
should I free that structure when I'm done ?   Or should the next call to
gethostbyname() free the previously allocated structure ?   (it seems as though
it doesn't).

If I should free it, then how do I accomplish that ?   Will a simple free() do
the trick, or should I free all the arrays of arrays that the structure can
contain ?

Thanks in advance,

................................................................
: [EMAIL PROTECTED]  : And I see the elder races,         :
:.........................: putrid forms of man                :
:   Jakob �stergaard      : See him rise and claim the earth,  :
:        OZ9ABN           : his downfall is at hand.           :
:.........................:............{Konkhra}...............:
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to