mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547.
This commit is contained in:
4
tty.c
4
tty.c
@ -258,9 +258,13 @@ tty_open(struct tty *tty, char **cause)
|
||||
event_set(&tty->event_in, tty->fd, EV_PERSIST|EV_READ,
|
||||
tty_read_callback, tty);
|
||||
tty->in = evbuffer_new();
|
||||
if (tty->in == NULL)
|
||||
fatal("out of memory");
|
||||
|
||||
event_set(&tty->event_out, tty->fd, EV_WRITE, tty_write_callback, tty);
|
||||
tty->out = evbuffer_new();
|
||||
if (tty->out == NULL)
|
||||
fatal("out of memory");
|
||||
|
||||
evtimer_set(&tty->timer, tty_timer_callback, tty);
|
||||
|
||||
|
Reference in New Issue
Block a user