setup: fix memory leak

Found by: Coverity scan.
CID: 73680, 73715
This commit is contained in:
Andrei Borzenkov 2016-01-09 13:10:10 +03:00
parent 67d9ce82ac
commit 57e7f1b775

View file

@ -353,6 +353,10 @@ SETUP (const char *dir,
} }
grub_util_info ("guessed root_dev `%s' from " grub_util_info ("guessed root_dev `%s' from "
"dir `%s'", root_dev->disk->name, dir); "dir `%s'", root_dev->disk->name, dir);
for (cur = root_devices; *cur; cur++)
free (*cur);
free (root_devices);
} }
grub_util_info ("setting the root device to `%s'", root); grub_util_info ("setting the root device to `%s'", root);