bool Resolver::tryGetSOASerial(DNSName *domain, uint32_t *theirSerial, uint32_t *theirInception, uint32_t *theirExpire, uint16_t* id)
{
- struct pollfd *fds = new struct pollfd[locals.size()];
+ auto fds = std::unique_ptr<struct pollfd[]>(new struct pollfd[locals.size()]);
size_t i = 0, k;
int sock;
fds[i].events = POLLIN;
}
- if (poll(fds, i, 250) < 1) { // wait for 0.25s
- delete [] fds;
+ if (poll(fds.get(), i, 250) < 1) { // wait for 0.25s
return false;
}
}
}
- delete [] fds;
-
if (sock < 0) return false; // false alarm
int err;