gterm: Prevent memory leak gterm_init() failure
This commit is contained in:
parent
fb994e61c6
commit
6e1c792e41
@ -776,15 +776,15 @@ no_load_font:;
|
||||
font_scale_x, font_scale_y,
|
||||
margin);
|
||||
|
||||
if (term == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
pmm_free(font, FONT_MAX);
|
||||
if (bg_canvas != NULL) {
|
||||
pmm_free(bg_canvas, bg_canvas_size);
|
||||
}
|
||||
|
||||
if (term == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (serial) {
|
||||
term->cols = term->cols > 80 ? 80 : term->cols;
|
||||
term->rows = term->rows > 24 ? 24 : term->rows;
|
||||
|
Loading…
Reference in New Issue
Block a user