aboutsummaryrefslogtreecommitdiff
path: root/seatd/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'seatd/server.c')
-rw-r--r--seatd/server.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/seatd/server.c b/seatd/server.c
index 8ead54d..47d6e91 100644
--- a/seatd/server.c
+++ b/seatd/server.c
@@ -129,6 +129,12 @@ int server_add_client(struct server *server, int fd) {
}
struct client *client = client_create(server, fd);
+ if (client == NULL) {
+ log_errorf("Could not create client: %s", strerror(errno));
+ close(fd);
+ return -1;
+ }
+
client->event_source =
poller_add_fd(&server->poller, fd, EVENT_READABLE, client_handle_connection, client);
if (client->event_source == NULL) {