diff options
| author | 2018-11-19 13:35:40 +0000 | |
|---|---|---|
| committer | 2018-11-19 13:35:40 +0000 | |
| commit | b32e1d34e10a0da806823f57f02a4ae6e93d756e (patch) | |
| tree | 60ce146238243ec139a9af28986d7606c4a4871d /usr.bin/tmux/window.c | |
| parent | Utilize sigio with sockets. (diff) | |
| download | wireguard-openbsd-b32e1d34e10a0da806823f57f02a4ae6e93d756e.tar.xz wireguard-openbsd-b32e1d34e10a0da806823f57f02a4ae6e93d756e.zip | |
evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547.
Diffstat (limited to 'usr.bin/tmux/window.c')
| -rw-r--r-- | usr.bin/tmux/window.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index 998f2087e9a..a0ba831f299 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.213 2018/10/18 08:38:01 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.214 2018/11/19 13:35:41 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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); |
