diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2018-11-19 13:35:42 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2018-11-19 13:35:42 +0000 |
commit | ae11f7be0b29f733d6206c7c728671e805e93f44 (patch) | |
tree | 7c849254c83befc6350da4b17f4f972541bcec9a /usr.bin/tmux/input.c | |
parent | 0b9426ab228141fe19c2c87efedb86a47cfcb2bc (diff) |
evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547.
Diffstat (limited to 'usr.bin/tmux/input.c')
-rw-r--r-- | usr.bin/tmux/input.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c index e97f6d7c690..df920b34f0a 100644 --- a/usr.bin/tmux/input.c +++ b/usr.bin/tmux/input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input.c,v 1.138 2018/10/18 08:04:14 nicm Exp $ */ +/* $OpenBSD: input.c,v 1.139 2018/11/19 13:35:41 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -767,6 +767,8 @@ input_init(struct window_pane *wp) ictx->input_buf = xmalloc(INPUT_BUF_START); ictx->since_ground = evbuffer_new(); + if (ictx->since_ground == NULL) + fatalx("out of memory"); evtimer_set(&ictx->timer, input_timer_callback, ictx); |