summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2022-08-24 07:22:31 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2022-08-24 07:22:31 +0000
commitd5eef0117180cf75a4984bc54417c87533a6f15a (patch)
tree24f782d83c55b763600ac84c7808d70bf3cdb757 /usr.bin/tmux/window.c
parentcde1ef766beed750c2be4f30c8dfb49b2304b39f (diff)
Check for NULL returns from bufferevent_new.
Diffstat (limited to 'usr.bin/tmux/window.c')
-rw-r--r--usr.bin/tmux/window.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index 44c5b886953..c1edcdd22e0 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.281 2022/06/17 07:28:05 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.282 2022/08/24 07:22:30 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1033,6 +1033,8 @@ window_pane_set_event(struct window_pane *wp)
wp->event = bufferevent_new(wp->fd, window_pane_read_callback,
NULL, window_pane_error_callback, wp);
+ if (wp->event == NULL)
+ fatalx("out of memory");
wp->ictx = input_init(wp, wp->event, &wp->palette);
bufferevent_enable(wp->event, EV_READ|EV_WRITE);