I have this code for getting information about IPv4 address:
struct addrinfo hints, *info = NULL;
char addr4[INET_ADDRSTRLEN];
memset(&hints, 0, sizeof(h
This may not be a memory leak (technically it is, but you shouldn't worry about it) sometimes libraries allocate memory the first time a function is called for subsequent calls. you can have valgrind suppress those errors if you want.
From the FAQ:
"still reachable" means your program is probably ok -- it didn't free some memory it could have. This is quite common and often reasonable. Don't use --show-reachable=yes if you don't want to see these reports.