mirror of
git://git.proxmox.com/git/qemu-server.git
synced 2024-12-22 13:34:06 +03:00
qmeventd: catch calloc error
even if close to impossible to happen, NULL dereferences are never nice.. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
aedf820870
commit
6d4f89b6a4
@ -353,6 +353,11 @@ void
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user