]> sourceware.org Git - lvm2.git/commitdiff
missing reply frees
authorAlasdair Kergon <agk@redhat.com>
Fri, 2 Mar 2012 21:24:37 +0000 (21:24 +0000)
committerAlasdair Kergon <agk@redhat.com>
Fri, 2 Mar 2012 21:24:37 +0000 (21:24 +0000)
lib/cache/lvmetad.c

index e087c7233dfc8ad2ef401babaac5ee4d8567fef9..cae999e587b7b5d4ffb4a1c208f8fc52bdff0460 100644 (file)
@@ -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) {
This page took 0.044522 seconds and 5 git commands to generate.