diff options
author | Thomas Adam <thomas@xteddy.org> | 2018-11-19 14:02:41 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2018-11-19 14:02:41 +0000 |
commit | efd01f3bfd84d4a692cfbf746517f891d4ecaa27 (patch) | |
tree | b2ed5d4a20750075b483711c63493dffc81d6348 | |
parent | a7da2357a512d5a325aa12ca0d544df85530a4d3 (diff) | |
parent | 749f67b7d801eed03345fef9c04206fbd079c3cb (diff) | |
download | rtmux-efd01f3bfd84d4a692cfbf746517f891d4ecaa27.tar.gz rtmux-efd01f3bfd84d4a692cfbf746517f891d4ecaa27.tar.bz2 rtmux-efd01f3bfd84d4a692cfbf746517f891d4ecaa27.zip |
Merge branch 'obsd-master'
-rw-r--r-- | cmd-pipe-pane.c | 2 | ||||
-rw-r--r-- | control-notify.c | 2 | ||||
-rw-r--r-- | format.c | 4 | ||||
-rw-r--r-- | input.c | 2 | ||||
-rw-r--r-- | job.c | 2 | ||||
-rw-r--r-- | server-client.c | 6 | ||||
-rw-r--r-- | tty.c | 4 | ||||
-rw-r--r-- | window.c | 2 |
8 files changed, 24 insertions, 0 deletions
diff --git a/cmd-pipe-pane.c b/cmd-pipe-pane.c index 7683df31..411d21e5 100644 --- a/cmd-pipe-pane.c +++ b/cmd-pipe-pane.c @@ -165,6 +165,8 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmdq_item *item) cmd_pipe_pane_write_callback, cmd_pipe_pane_error_callback, wp); + if (wp->pipe_event == NULL) + fatalx("out of memory"); if (out) bufferevent_enable(wp->pipe_event, EV_WRITE); if (in) diff --git a/control-notify.c b/control-notify.c index 49291483..7b28e8f0 100644 --- a/control-notify.c +++ b/control-notify.c @@ -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] == '\\') @@ -588,6 +588,8 @@ format_cb_pane_tabs(struct format_tree *ft, struct format_entry *fe) return; buffer = evbuffer_new(); + if (buffer == NULL) + fatalx("out of memory"); for (i = 0; i < wp->base.grid->sx; i++) { if (!bit_test(wp->base.tabs, i)) continue; @@ -618,6 +620,8 @@ format_cb_session_group_list(struct format_tree *ft, struct format_entry *fe) return; buffer = evbuffer_new(); + if (buffer == NULL) + fatalx("out of memory"); TAILQ_FOREACH(loop, &sg->sessions, gentry) { if (EVBUFFER_LENGTH(buffer) > 0) evbuffer_add(buffer, ",", 1); @@ -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); @@ -154,6 +154,8 @@ job_run(const char *cmd, struct session *s, const char *cwd, job->event = bufferevent_new(job->fd, job_read_callback, job_write_callback, job_error_callback, job); + if (job->event == NULL) + fatalx("out of memory"); bufferevent_enable(job->event, EV_READ|EV_WRITE); log_debug("run job %p: %s, pid %ld", job, job->cmd, (long) job->pid); diff --git a/server-client.c b/server-client.c index 9495f003..41e4a1a5 100644 --- a/server-client.c +++ b/server-client.c @@ -184,8 +184,14 @@ server_client_create(int fd) TAILQ_INIT(&c->queue); c->stdin_data = evbuffer_new(); + if (c->stdin_data == NULL) + fatalx("out of memory"); c->stdout_data = evbuffer_new(); + if (c->stdout_data == NULL) + fatalx("out of memory"); c->stderr_data = evbuffer_new(); + if (c->stderr_data == NULL) + fatalx("out of memory"); c->tty.fd = -1; c->title = NULL; @@ -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); @@ -1010,6 +1010,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); |