From 377c121170f37107012a01382bb5da5198b87d72 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 1 Feb 2017 21:21:17 +0100 Subject: [PATCH] mkimage: Fix memory leak. --- util/grub-mkimage.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util/grub-mkimage.c b/util/grub-mkimage.c index 10375f4d2..aba19d21b 100644 --- a/util/grub-mkimage.c +++ b/util/grub-mkimage.c @@ -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);