Skip to contentSkip to conversation

master - cleanup: add missing error path check

PATCH Zdenek Kabelac 1 participant 1 message Nov 22, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a6a7a3a074692a66d065d19e58e6e170233ab9e9
Commit:        a6a7a3a074692a66d065d19e58e6e170233ab9e9
Parent:        ccdea661fa2aab07fbd73bfd7f8fe5273acd71c0
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sat Nov 22 22:39:56 2014 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Sun Nov 23 00:49:04 2014 +0100

cleanup: add missing error path check

New code misses error path check.

---
 tools/toollib.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
tools/toollib.c +2 -1
index 00512a3..ddf2dcf 100644
@@ -1149,7 +1149,8 @@ struct dm_config_tree *get_cachepolicy_params(struct cmd_context *cmd)
 			goto_out;
 	}
 
-	result = dm_config_flatten(current);
+	if (!(result = dm_config_flatten(current)))
+		goto_out;
 
 	if (!(cn = dm_config_create_node(result, "policy_settings")))
 		goto_out;