so there is no mem leak on this error path.
Also actually check if the hash exists.
const char *vgid, int nuke_empty)
{
struct dm_config_node *pv = pvs(vg->root);
- struct dm_hash_table *to_check = dm_hash_create(32);
+ struct dm_hash_table *to_check;
struct dm_hash_node *n;
const char *pvid;
const char *vgid_old;
if (!vgid)
return 0;
+ if (!(to_check = dm_hash_create(32)))
+ return 0;
+
while (pv) {
pvid = dm_config_find_str(pv->child, "id", NULL);
vgid_old = dm_hash_lookup(s->pvid_to_vgid, pvid);