]> sourceware.org Git - lvm2.git/commitdiff
dumpconfig: check conf tree was created
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 19 Jul 2013 15:32:08 +0000 (17:32 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 22 Jul 2013 10:41:21 +0000 (12:41 +0200)
Missing error path.

tools/dumpconfig.c

index da216f5136d33ef28c030bf9eb09774e949258fd..08872978e8761d8a5e919e254a374a6fa46b8698 100644 (file)
@@ -196,8 +196,11 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
        if (cft_check_handle)
                tree_spec.check_status = cft_check_handle->status;
 
-       if (tree_spec.type != CFG_DEF_TREE_CURRENT)
-               cft = config_def_create_tree(&tree_spec);
+       if ((tree_spec.type != CFG_DEF_TREE_CURRENT) &&
+           !(cft = config_def_create_tree(&tree_spec))) {
+               r = ECMD_FAILED;
+               goto_out;
+       }
 
        if (!config_write(cft, arg_count(cmd, withcomments_ARG),
                          arg_count(cmd, withversions_ARG),
This page took 0.03256 seconds and 5 git commands to generate.