Added
Link Here
|
1 |
Index: control.c |
2 |
=================================================================== |
3 |
--- control.c |
4 |
+++ control.c |
5 |
@@ -775,6 +775,9 @@ control_start(struct client *c) |
6 |
|
7 |
cs->read_event = bufferevent_new(c->fd, control_read_callback, |
8 |
control_write_callback, control_error_callback, c); |
9 |
+ if (cs->read_event == NULL) |
10 |
+ fatalx("out of memory"); |
11 |
+ |
12 |
bufferevent_enable(cs->read_event, EV_READ); |
13 |
|
14 |
if (c->flags & CLIENT_CONTROLCONTROL) |
15 |
@@ -782,6 +785,8 @@ control_start(struct client *c) |
16 |
else { |
17 |
cs->write_event = bufferevent_new(c->out_fd, NULL, |
18 |
control_write_callback, control_error_callback, c); |
19 |
+ if (cs->write_event == NULL) |
20 |
+ fatalx("out of memory"); |
21 |
} |
22 |
bufferevent_setwatermark(cs->write_event, EV_WRITE, CONTROL_BUFFER_LOW, |
23 |
0); |
24 |
Index: file.c |
25 |
=================================================================== |
26 |
--- file.c |
27 |
+++ file.c |
28 |
@@ -585,6 +585,8 @@ file_write_open(struct client_files *fil |
29 |
|
30 |
cf->event = bufferevent_new(cf->fd, NULL, file_write_callback, |
31 |
file_write_error_callback, cf); |
32 |
+ if (cf->event == NULL) |
33 |
+ fatalx("out of memory"); |
34 |
bufferevent_enable(cf->event, EV_WRITE); |
35 |
goto reply; |
36 |
|
37 |
@@ -744,6 +746,8 @@ file_read_open(struct client_files *file |
38 |
|
39 |
cf->event = bufferevent_new(cf->fd, file_read_callback, NULL, |
40 |
file_read_error_callback, cf); |
41 |
+ if (cf->event == NULL) |
42 |
+ fatalx("out of memory"); |
43 |
bufferevent_enable(cf->event, EV_READ); |
44 |
return; |
45 |
|
46 |
Index: window.c |
47 |
=================================================================== |
48 |
--- window.c |
49 |
+++ window.c |
50 |
@@ -1042,6 +1042,8 @@ window_pane_set_event(struct window_pane |
51 |
|
52 |
wp->event = bufferevent_new(wp->fd, window_pane_read_callback, |
53 |
NULL, window_pane_error_callback, wp); |
54 |
+ if (wp->event == NULL) |
55 |
+ fatalx("out of memory"); |
56 |
wp->ictx = input_init(wp, wp->event, &wp->palette); |
57 |
|
58 |
bufferevent_enable(wp->event, EV_READ|EV_WRITE); |