fix a memory leak
This commit is contained in:
parent
ec4689e82f
commit
57a095bc01
1 changed files with 5 additions and 1 deletions
|
@ -228,9 +228,13 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv,
|
|||
|
||||
grub_err_t add_arg (char *s)
|
||||
{
|
||||
char **p = argl;
|
||||
argl = grub_realloc (argl, (++num) * sizeof (char *));
|
||||
if (! argl)
|
||||
return grub_errno;
|
||||
{
|
||||
grub_free (p);
|
||||
return grub_errno;
|
||||
}
|
||||
argl[num - 1] = s;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue