Fixing memleak with getifaddrs()