inside func(), after the call to getaddrinfo I check if "ip_list" == NULL... The result is that it's not NULL, but inside main it becomes NULL if I check after calling func(), and I can't figure out why. I want to use ip_list after the call to func() but it's null then :S