Subject: | memory leak |
--- line 582
#if (defined(USE_GETIFADDRS) && defined(HAVE_SOCKADDR_DL_STRUCT))
getifaddrs(&ifap);
while(1) {
if (ifap == NULL) break;
if (strncmp(name, ifap -> ifa_name, IFNAMSIZ) == 0) {
family = ifap -> ifa_addr -> sa_family;
if (family == AF_LINK) {
sdl = (struct sockaddr_dl *) ifap->ifa_addr;
haddr = sdl->sdl_data + sdl->sdl_nlen;
hlen = sdl->sdl_alen;
break;
}
}
ifap = ifap -> ifa_next; <- memory leak!
}
freeifaddrs(ifap); (free what? it is null here)