diff --git a/src/connection.c b/src/connection.c index 6e3f1dd..5c5ac31 100644 --- a/src/connection.c +++ b/src/connection.c @@ -59,6 +59,10 @@ connection_new(unsigned int source_port, const char* source_ip, unsigned int des struct Connection* connection_poll_ready(struct Client* client) { + // Return a null connection if no sockets have been opened + if(max_fds < 0) + return NULL; + // Add all the connections' socket file descriptors to a watch list fd_set read_fds; FD_ZERO(&read_fds);