1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmetad: fix error paths

Also add missing goto out on error.
Error path missed return NULL leading to double free of enc_value.
This commit is contained in:
Zdenek Kabelac 2013-04-19 21:19:54 +02:00
parent 377e06b0f8
commit f787b575b5
3 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
Fix lvmetad error path in lvmetad_vg_lookup() for null vgname.
Fix clvmd _cluster_request() return code in memory fail path.
Add writemostly/writebehind support for RAID1
Add lv_change_activate() for common activation code in vg/lvchange.

4
lib/cache/lvmetad.c vendored
View File

@ -343,8 +343,10 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd, const char *vgna
reply = _lvmetad_send("vg_lookup", "uuid = %s", uuid, NULL);
diag_name = uuid;
} else {
if (!vgname)
if (!vgname) {
log_error(INTERNAL_ERROR "VG name required (VGID not available)");
goto out;
}
log_debug_lvmetad("Asking lvmetad for VG %s", vgname);
reply = _lvmetad_send("vg_lookup", "name = %s", vgname, NULL);
diag_name = vgname;

View File

@ -967,6 +967,7 @@ static struct dm_config_value *_get_def_array_values(struct dm_config_tree *cft,
if (!(v = dm_config_create_value(cft))) {
log_error("Failed to create default config array value for %s.", def->name);
dm_free(enc_value);
return NULL;
}
if (oldv)
oldv->next = v;