summaryrefslogtreecommitdiffstats
path: root/server-client.c
diff options
context:
space:
mode:
authornicm <nicm>2018-11-19 13:35:40 +0000
committernicm <nicm>2018-11-19 13:35:40 +0000
commit749f67b7d801eed03345fef9c04206fbd079c3cb (patch)
treec3f0924151a023f0f0fc52e8174577a10be94d64 /server-client.c
parentf103927a5232e0d3e8e7ad0e13aa53b4dfa2c87b (diff)
evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547.
Diffstat (limited to 'server-client.c')
-rw-r--r--server-client.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/server-client.c b/server-client.c
index 3d939163..94cc9e92 100644
--- a/server-client.c
+++ b/server-client.c
@@ -186,8 +186,14 @@ server_client_create(int fd)
TAILQ_INIT(&c->queue);
c->stdin_data = evbuffer_new();
+ if (c->stdin_data == NULL)
+ fatalx("out of memory");
c->stdout_data = evbuffer_new();
+ if (c->stdout_data == NULL)
+ fatalx("out of memory");
c->stderr_data = evbuffer_new();
+ if (c->stderr_data == NULL)
+ fatalx("out of memory");
c->tty.fd = -1;
c->title = NULL;