aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2013-04-21 13:12:58 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2013-04-21 22:56:59 +0200
commitba3cee36300d56efcdcb0af883141b1b0a6129a1 (patch)
treee2d6c52c2411d4ab97009b878191ed4708bffdba /lib
parent5070ffbca7b16e4139b3da72bdff0c9add517351 (diff)
downloadlvm2-ba3cee36300d56efcdcb0af883141b1b0a6129a1.tar.gz
config: check for hash success
Hash insert may fail.
Diffstat (limited to 'lib')
-rw-r--r--lib/config/config.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/config/config.c b/lib/config/config.c
index 2c77f3076..d1cf590ff 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -577,7 +577,11 @@ int config_def_check(struct cmd_context *cmd, int force, int skip, int suppress_
cmd->cft_def_hash = NULL;
r = 0; goto out;
}
- dm_hash_insert(cmd->cft_def_hash, vp, def);
+ if (!dm_hash_insert(cmd->cft_def_hash, vp, def)) {
+ log_error("Failed to insert configuration to hash.");
+ r = 0;
+ goto out;
+ }
}
}