evbuffer_new and bufferevent_new can both fail (when malloc fails) and

return NULL. GitHub issue 1547.
This commit is contained in:
nicm
2018-11-19 13:35:40 +00:00
parent f103927a52
commit 749f67b7d8
8 changed files with 24 additions and 0 deletions

View File

@ -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);