rescue: Don't leak various variables when using --suggest option with multi-boot guests.

This fixes a leak which was introduced in
commit 4255db65e5.

Found by Coverity.
This commit is contained in:
Richard W.M. Jones
2014-03-28 14:25:42 +00:00
parent 15b06d6100
commit c8657535fd

View File

@@ -384,10 +384,7 @@ static void
do_suggestion (struct drv *drvs)
{
CLEANUP_FREE_STRING_LIST char **roots = NULL;
size_t i, j;
CLEANUP_FREE char *type = NULL, *distro = NULL, *product_name = NULL;
int major, minor;
CLEANUP_FREE_STRING_LIST char **mps = NULL;
size_t i;
/* For inspection, force add_drives to add the drives read-only. */
read_only = 1;
@@ -421,6 +418,11 @@ do_suggestion (struct drv *drvs)
"commands in virt-rescue (at the ><rescue> prompt) to mount the filesystems.\n\n"));
for (i = 0; roots[i] != NULL; ++i) {
CLEANUP_FREE_STRING_LIST char **mps = NULL;
CLEANUP_FREE char *type = NULL, *distro = NULL, *product_name = NULL;
int major, minor;
size_t j;
type = guestfs_inspect_get_type (g, roots[i]);
distro = guestfs_inspect_get_distro (g, roots[i]);
product_name = guestfs_inspect_get_product_name (g, roots[i]);