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/control-notify.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/control-notify.c')
-rw-r--r-- | usr.bin/tmux/control-notify.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tmux/control-notify.c b/usr.bin/tmux/control-notify.c index ecd64aca943..5927a5e9322 100644 --- a/usr.bin/tmux/control-notify.c +++ b/usr.bin/tmux/control-notify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control-notify.c,v 1.21 2017/05/04 07:16:43 nicm Exp $ */ +/* $OpenBSD: control-notify.c,v 1.22 2018/11/19 13:35:40 nicm Exp $ */ /* * Copyright (c) 2012 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -47,6 +47,8 @@ control_notify_input(struct client *c, struct window_pane *wp, */ if (winlink_find_by_window(&c->session->windows, wp->window) != NULL) { message = evbuffer_new(); + if (message == NULL) + fatalx("out of memory"); evbuffer_add_printf(message, "%%output %%%u ", wp->id); for (i = 0; i < len; i++) { if (buf[i] < ' ' || buf[i] == '\\') |