From ba3cee36300d56efcdcb0af883141b1b0a6129a1 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 21 Apr 2013 13:12:58 +0200 Subject: [PATCH] config: check for hash success Hash insert may fail. --- lib/config/config.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; + } } }