]> sourceware.org Git - lvm2.git/commitdiff
reporter: properly check for _do_info_and_status return value and free the mempool...
authorPeter Rajnoha <prajnoha@redhat.com>
Mon, 9 Feb 2015 10:48:21 +0000 (11:48 +0100)
committerPeter Rajnoha <prajnoha@redhat.com>
Mon, 9 Feb 2015 10:48:21 +0000 (11:48 +0100)
tools/reporter.c

index 7c481be087bcc8edce4fd23cf669009f12a07150..20fa4ab1653204f2f8757bb635b5e94bd21d1b0e 100644 (file)
@@ -92,10 +92,8 @@ static int _do_lvs_with_info_and_status_single(struct cmd_context *cmd,
        };
        int r = ECMD_FAILED;
 
-       if (!_do_info_and_status(cmd, lv, NULL, &status, do_info, do_status)) {
-               stack;
-               return r;
-       }
+       if (!_do_info_and_status(cmd, lv, NULL, &status, do_info, do_status))
+               goto_out;
 
        if (!report_object(handle, lv->vg, lv, NULL, NULL, NULL,
                           &status, NULL))
@@ -143,10 +141,8 @@ static int _do_segs_with_info_and_status_single(struct cmd_context *cmd,
        };
        int r = ECMD_FAILED;
 
-       if (!_do_info_and_status(cmd, seg->lv, seg, &status, do_info, do_status)) {
-               stack;
-               return r;
-       }
+       if (!_do_info_and_status(cmd, seg->lv, seg, &status, do_info, do_status))
+               goto_out;
 
        if (!report_object(handle, seg->lv->vg, seg->lv, NULL, seg, NULL,
                           &status, NULL))
@@ -268,8 +264,8 @@ static int _do_pvsegs_sub_single(struct cmd_context *cmd,
                .lv = &_free_logical_volume
        };
 
-       if (seg)
-               _do_info_and_status(cmd, seg->lv, seg, &status, do_info, do_status);
+       if (seg && !_do_info_and_status(cmd, seg->lv, seg, &status, do_info, do_status))
+               goto_out;
 
        if (!report_object(handle, vg, seg ? seg->lv : &_free_logical_volume, pvseg->pv,
                           seg ? : &_free_lv_segment, pvseg, &status,
This page took 0.038007 seconds and 5 git commands to generate.