* grub-core/script/script.c (grub_script_parse): Free parsed on
failure.
This commit is contained in:
parent
46422ebf1a
commit
2053cc077b
2 changed files with 10 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2010-08-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/script/script.c (grub_script_parse): Free parsed on
|
||||
failure.
|
||||
|
||||
2010-08-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/normal/completion.c (grub_normal_do_completion): Free argv
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue