script: fix memory leak
Found by: Coverity scan. CID: 96637
This commit is contained in:
parent
26533fe6bc
commit
b95e926788
1 changed files with 5 additions and 9 deletions
|
@ -681,17 +681,13 @@ grub_script_arglist_to_argv (struct grub_script_arglist *arglist,
|
||||||
}
|
}
|
||||||
*op = '\0';
|
*op = '\0';
|
||||||
|
|
||||||
if (grub_script_argv_append (&result, p, op - p))
|
need_cleanup = grub_script_argv_append (&result, p, op - p);
|
||||||
{
|
|
||||||
grub_free (p);
|
grub_free (p);
|
||||||
need_cleanup = 1;
|
|
||||||
/* Fall through to cleanup */
|
/* Fall through to cleanup */
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (append (&result, values[i], 1))
|
need_cleanup = append (&result, values[i], 1);
|
||||||
need_cleanup = 1;
|
|
||||||
/* Fall through to cleanup */
|
/* Fall through to cleanup */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue