fixing memory leak on getifaddrs