terminal: Convert all *alloc's to x*alloc's.
This ensures the allocation results are checked for NULL (out of memory), and terminates the program in such a case. Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
This commit is contained in:
committed by
Kristian Høgsberg
parent
1e40a7ec7a
commit
66cd2c1ce1
+3
-3
@@ -772,10 +772,10 @@ terminal_resize_cells(struct terminal *terminal,
|
|||||||
} else {
|
} else {
|
||||||
terminal->max_width = width;
|
terminal->max_width = width;
|
||||||
data_pitch = width * sizeof(union utf8_char);
|
data_pitch = width * sizeof(union utf8_char);
|
||||||
data = zalloc(data_pitch * terminal->buffer_height);
|
data = xzalloc(data_pitch * terminal->buffer_height);
|
||||||
attr_pitch = width * sizeof(struct attr);
|
attr_pitch = width * sizeof(struct attr);
|
||||||
data_attr = malloc(attr_pitch * terminal->buffer_height);
|
data_attr = xmalloc(attr_pitch * terminal->buffer_height);
|
||||||
tab_ruler = zalloc(width);
|
tab_ruler = xzalloc(width);
|
||||||
attr_init(data_attr, terminal->curr_attr,
|
attr_init(data_attr, terminal->curr_attr,
|
||||||
width * terminal->buffer_height);
|
width * terminal->buffer_height);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user