On Fri, Jan 16, 2015 at 3:03 PM, <pulkomandy@xxxxxxxxxxxxx> wrote: > while (interface->GetAddressAt(i++, address) == B_OK) { > - current = new ifaddrs(); > + if (interface == NULL) { This makes no sense. you already derecerenced the interface pointer > + current = new(std::nothrow) ifaddrs(); > + if (current == NULL) { > + freeifaddrs(previous); you need to delete interface here as well. regards Marcus