mkimage: Fix memory leak.

This commit is contained in:
Vladimir Serbinenko 2017-02-01 21:21:17 +01:00
parent 43b444e593
commit 377c121170

View file

@ -240,6 +240,7 @@ main (int argc, char *argv[])
{
FILE *fp = stdout;
struct arguments arguments;
unsigned i;
grub_util_host_init (&argc, &argv);
@ -304,7 +305,12 @@ main (int argc, char *argv[])
grub_util_file_sync (fp);
fclose (fp);
for (i = 0; i < arguments.nmodules; i++)
free (arguments.modules[i]);
free (arguments.dir);
free (arguments.prefix);
free (arguments.modules);
if (arguments.output)
free (arguments.output);