diff --git a/ChangeLog b/ChangeLog index 0779d7c8f..2ffbbcd7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-08-28 Vladimir Serbinenko + + * grub-core/script/script.c (grub_script_parse): Free parsed on + failure. + 2010-08-28 Vladimir Serbinenko * grub-core/normal/completion.c (grub_normal_do_completion): Free argv diff --git a/grub-core/script/script.c b/grub-core/script/script.c index 9cee40dcb..448bdf775 100644 --- a/grub-core/script/script.c +++ b/grub-core/script/script.c @@ -365,7 +365,10 @@ grub_script_parse (char *script, grub_reader_getline_t getline) parsestate = grub_zalloc (sizeof (*parsestate)); if (!parsestate) - return 0; + { + grub_free (parsed); + return 0; + } /* Initialize the lexer. */ lexstate = grub_script_lexer_init (parsestate, script, getline); @@ -388,6 +391,7 @@ grub_script_parse (char *script, grub_reader_getline_t getline) grub_script_mem_free (memfree); grub_script_lexer_fini (lexstate); grub_free (parsestate); + grub_free (parsed); return 0; }