summaryrefslogtreecommitdiffstats
path: root/window.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 /window.c
parentf103927a5232e0d3e8e7ad0e13aa53b4dfa2c87b (diff)
evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547.
Diffstat (limited to 'window.c')
-rw-r--r--window.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/window.c b/window.c
index 6e76b480..530d9574 100644
--- a/window.c
+++ b/window.c
@@ -997,6 +997,8 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
wp->event = bufferevent_new(wp->fd, window_pane_read_callback, NULL,
window_pane_error_callback, wp);
+ if (wp->event == NULL)
+ fatalx("out of memory");
bufferevent_setwatermark(wp->event, EV_READ, 0, READ_SIZE);
bufferevent_enable(wp->event, EV_READ|EV_WRITE);