gterm: Prevent memory leak gterm_init() failure
This commit is contained in:
parent
aca99ad790
commit
5bbda71da2
|
@ -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