diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index d0e8f7df1..c46db61e7 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.77 - ================================= + Don't create value for dm_config_node and require dm_config_create_value call. Check for existing new_name for dmsetup rename. Fix memory leak in dmsetup _get_split_name() error path. diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c index 3ca3fd52e..146ee6986 100644 --- a/daemons/lvmetad/lvmetad-core.c +++ b/daemons/lvmetad/lvmetad-core.c @@ -520,12 +520,19 @@ static response vg_lookup(lvmetad_state *s, request r) if (!(res.cft->root = n = dm_config_create_node(res.cft, "response"))) goto bad; + if (!(n->v = dm_config_create_value(cft))) + goto bad; + n->parent = res.cft->root; n->v->type = DM_CFG_STRING; n->v->v.str = "OK"; if (!(n = n->sib = dm_config_create_node(res.cft, "name"))) goto bad; + + if (!(n->v = dm_config_create_value(res.cft))) + goto bad; + n->parent = res.cft->root; n->v->type = DM_CFG_STRING; n->v->v.str = name; diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c index f8c095477..c19f51d71 100644 --- a/libdm/libdm-config.c +++ b/libdm/libdm-config.c @@ -1169,14 +1169,9 @@ struct dm_config_node *dm_config_create_node(struct dm_config_tree *cft, const c log_error("Failed to create config node's key."); return NULL; } - if (!(cn->v = _create_value(cft->mem))) { - log_error("Failed to create config node's value."); - return NULL; - } cn->parent = NULL; - cn->v->type = DM_CFG_INT; - cn->v->v.i = 0; - cn->v->next = NULL; + cn->v = NULL; + return cn; }