diff options
author | Alasdair Kergon <agk@redhat.com> | 2012-03-02 21:24:37 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2012-03-02 21:24:37 +0000 |
commit | 865738f2710c2d6e50616bfa8d7cf268e7a6a29c (patch) | |
tree | 14dd251c40ca57d6e347adddb7f0a12a8c1cc52f /lib/cache/lvmetad.c | |
parent | 9c159ea320a4cf9db8d48c4983ccb4088a980d55 (diff) | |
download | lvm2-865738f2710c2d6e50616bfa8d7cf268e7a6a29c.tar.gz lvm2-865738f2710c2d6e50616bfa8d7cf268e7a6a29c.tar.xz lvm2-865738f2710c2d6e50616bfa8d7cf268e7a6a29c.zip |
missing reply frees
Diffstat (limited to 'lib/cache/lvmetad.c')
-rw-r--r-- | lib/cache/lvmetad.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c index e087c723..cae999e5 100644 --- a/lib/cache/lvmetad.c +++ b/lib/cache/lvmetad.c @@ -208,7 +208,7 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd, const char *vgna log_error(INTERNAL_ERROR "We do not know the format (%s) reported by lvmetad.", fmt_name); - return NULL; + goto out; } fic.type = FMT_INSTANCE_MDAS | FMT_INSTANCE_AUX_MDAS; @@ -216,7 +216,7 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd, const char *vgna fic.context.vg_ref.vg_id = vgid; if (!(fid = fmt->ops->create_instance(fmt, &fic))) - return_NULL; + goto_out; if ((pvcn = dm_config_find_node(top, "metadata/physical_volumes"))) for (pvcn = pvcn->child; pvcn; pvcn = pvcn->sib) @@ -224,21 +224,25 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd, const char *vgna top->key = name; if (!(vg = import_vg_from_config_tree(reply.cft, fid))) - return_NULL; + goto_out; dm_list_iterate_items(pvl, &vg->pvs) { if ((info = lvmcache_info_from_pvid((const char *)&pvl->pv->id, 0))) { pvl->pv->label_sector = lvmcache_get_label(info)->sector; pvl->pv->dev = lvmcache_device(info); - if (!lvmcache_fid_add_mdas_pv(info, fid)) - return_NULL; /* FIXME error path */ + if (!lvmcache_fid_add_mdas_pv(info, fid)) { + vg = NULL; + goto_out; /* FIXME error path */ + } } /* else probably missing */ } lvmcache_update_vg(vg, 0); } +out: daemon_reply_destroy(reply); + return vg; } @@ -285,8 +289,7 @@ int lvmetad_vg_update(struct volume_group *vg) } reply = daemon_send_simple(_lvmetad, "vg_update", "vgname = %s", vg->name, - "metadata = %b", strchr(buf, '{'), - NULL); + "metadata = %b", strchr(buf, '{'), NULL); dm_free(buf); if (!_lvmetad_handle_reply(reply, "update VG", vg->name, NULL)) { @@ -294,6 +297,8 @@ int lvmetad_vg_update(struct volume_group *vg) return 0; } + daemon_reply_destroy(reply); + n = (vg->fid && vg->fid->metadata_areas_index) ? dm_hash_get_first(vg->fid->metadata_areas_index) : NULL; while (n) { |