devmapper/getroot: Fix memory leak.
Found by: Coverity scan.
This commit is contained in:
parent
6603c22f31
commit
c14dff3ca7
1 changed files with 7 additions and 1 deletions
|
@ -160,7 +160,10 @@ grub_util_pull_devmapper (const char *os_dev)
|
||||||
uuid = get_dm_uuid (os_dev);
|
uuid = get_dm_uuid (os_dev);
|
||||||
|
|
||||||
if (!grub_util_open_dm (os_dev, &tree, &node))
|
if (!grub_util_open_dm (os_dev, &tree, &node))
|
||||||
return;
|
{
|
||||||
|
grub_free (uuid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
while ((child = dm_tree_next_child (&handle, node, 0)))
|
while ((child = dm_tree_next_child (&handle, node, 0)))
|
||||||
{
|
{
|
||||||
|
@ -192,6 +195,7 @@ grub_util_pull_devmapper (const char *os_dev)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dm_tree_free (tree);
|
dm_tree_free (tree);
|
||||||
|
grub_free (uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
@ -253,6 +257,7 @@ grub_util_get_devmapper_grub_dev (const char *os_dev)
|
||||||
grub_free (uuid);
|
grub_free (uuid);
|
||||||
return grub_dev;
|
return grub_dev;
|
||||||
}
|
}
|
||||||
|
grub_free (uuid);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,6 +284,7 @@ grub_util_get_vg_uuid (const char *os_dev)
|
||||||
}
|
}
|
||||||
optr--;
|
optr--;
|
||||||
*optr = '\0';
|
*optr = '\0';
|
||||||
|
grub_free (uuid);
|
||||||
return vgid;
|
return vgid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue