Commit 0864f2ab authored by louiz’'s avatar louiz’

Quiet a warning

parent ed49e067
......@@ -63,14 +63,14 @@ void TCPSocketHandler::init_socket(const struct addrinfo* rp)
// used in bind()
struct addrinfo* result;
int err = ::getaddrinfo(this->bind_addr.data(), nullptr, nullptr, &result);
if (err != 0)
if (err != 0 || !result)
log_error("Failed to bind socket to " << this->bind_addr << ": "
<< gai_strerror(err));
else
{
utils::ScopeGuard sg([result](){ freeaddrinfo(result); });
struct addrinfo* rp;
int bind_error;
int bind_error = 0;
for (rp = result; rp; rp = rp->ai_next)
{
if ((bind_error = ::bind(this->socket,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment