even if close to impossible to happen, NULL dereferences are never
nice..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
add_new_client(int client_fd)
{
struct Client *client = calloc(sizeof(struct Client), 1);
add_new_client(int client_fd)
{
struct Client *client = calloc(sizeof(struct Client), 1);
+ if (client == NULL) {
+ fprintf(stderr, "could not add new client - allocation failed!\n");
+ fflush(stderr);
+ return;
+ }
client->state = STATE_HANDSHAKE;
client->type = CLIENT_NONE;
client->fd = client_fd;
client->state = STATE_HANDSHAKE;
client->type = CLIENT_NONE;
client->fd = client_fd;