diff --git a/http/socket.c b/http/socket.c
index 161fde5..2cc11a6 100644
--- a/http/socket.c
+++ b/http/socket.c
@@ -99,15 +99,13 @@ p_socket socket_init_listen (p_socket s, const s_str *host,
error_reason = "socket_init_listen: listen: ";
goto next;
}
+ *s = sockfd;
+ return s;
next:
res = res->ai_next;
}
- if (sockfd < 0) {
- err_write_1(error_reason);
- err_puts(strerror(e));
- assert(! "socket_init_listen");
- return NULL;
- }
- *s = sockfd;
- return s;
+ err_write_1(error_reason);
+ err_puts(strerror(e));
+ assert(! "socket_init_listen");
+ return NULL;
}