mirror of
git://git.proxmox.com/git/qemu-server.git
synced 2025-01-08 21:18:03 +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)
|
add_new_client(int client_fd)
|
||||||
{
|
{
|
||||||
struct Client *client = calloc(sizeof(struct Client), 1);
|
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->state = STATE_HANDSHAKE;
|
||||||
client->type = CLIENT_NONE;
|
client->type = CLIENT_NONE;
|
||||||
client->fd = client_fd;
|
client->fd = client_fd;
|
||||||
|
Loading…
Reference in New Issue
Block a user