From 6e3c515d5bf4480a38f0b6bb336f4e71a51af347 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Thu, 30 Sep 2010 21:07:51 +0200 Subject: [PATCH] * grub-core/gettext/gettext.c (grub_gettext_init_ext): Avoid using mo_file after freeing. --- ChangeLog | 5 +++++ grub-core/gettext/gettext.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c223a869c..0f0b65827 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-09-30 Vladimir Serbinenko + + * grub-core/gettext/gettext.c (grub_gettext_init_ext): Avoid using + mo_file after freeing. + 2010-09-30 Vladimir Serbinenko * grub-core/normal/term.c (read_terminal_list): Free in a right order. diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c index 2f94ac030..9ab4c3b8d 100644 --- a/grub-core/gettext/gettext.c +++ b/grub-core/gettext/gettext.c @@ -287,8 +287,10 @@ grub_gettext_init_ext (const char *lang) /* Will try adding .gz as well. */ if (fd_mo == NULL) { - grub_free (mo_file); + char *mo_file_old; + mo_file_old = mo_file; mo_file = grub_xasprintf ("%s.gz", mo_file); + grub_free (mo_file_old); if (!mo_file) return; fd_mo = grub_mofile_open (mo_file);