From: matz@... (Yukihiro Matsumoto) Date: 2002-06-12T01:18:48+09:00 Subject: Re: hostent extension problem - returning the ip address Hi, In message "hostent extension problem - returning the ip address" on 02/06/11, "Mr. Sunblade" writes: |I'm writing an extension that simply returns the hostname or ip addresses |for a given host. I'm having a problem with core dumps, however, and I |think it's because I'm not wrapping the return value from hptr->h_addr_list |(a pointer to an array of pointers that contain in_addr{}). I've tried a |few things and though it will compile, it continues to core dump/seg fault. |Any ideas? Here's my source (including extconf.rb source in comments): You are freeing struct hostent given by gethostname(3). gethostname(3) returns a pointer to static data, not to be freed. matz.