* grub-core/term/gfxterm.c (grub_gfxterm_term_fini): Free the text buffer.

(scroll_up): Fix a memory leak.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-08-28 15:28:08 +02:00
parent b17540cbd9
commit 3393cf16d6
2 changed files with 14 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2010-08-28 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/term/gfxterm.c (grub_gfxterm_term_fini): Free the text buffer.
(scroll_up): Fix a memory leak.
2010-08-28 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/nilfs2.c (grub_nilfs2_load_sb): Handle grub_disk_read

View File

@ -405,9 +405,16 @@ destroy_window (void)
static grub_err_t
grub_gfxterm_term_fini (struct grub_term_output *term __attribute__ ((unused)))
{
unsigned i;
destroy_window ();
grub_video_restore ();
for (i = 0; i < virtual_screen.columns * virtual_screen.rows; i++)
{
grub_free (virtual_screen.text_buffer[i].code);
virtual_screen.text_buffer[i].code = 0;
}
/* Clear error state. */
grub_errno = GRUB_ERR_NONE;
return GRUB_ERR_NONE;
@ -793,13 +800,8 @@ scroll_up (void)
unsigned int i;
/* Clear first line in text buffer. */
for (i = 0;
i < virtual_screen.columns;
i++)
{
virtual_screen.text_buffer[i].code = 0;
clear_char (&(virtual_screen.text_buffer[i]));
}
for (i = 0; i < virtual_screen.columns; i++)
grub_free (virtual_screen.text_buffer[i].code);
/* Scroll text buffer with one line to up. */
grub_memmove (virtual_screen.text_buffer,