Skip to contentSkip to conversation

master - config: check for hash success

PATCH Zdenek Kabelac 1 participant 1 message Apr 21, 2013

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ba3cee36300d56efcdcb0af883141b1b0a6129a1
Commit:        ba3cee36300d56efcdcb0af883141b1b0a6129a1
Parent:        5070ffbca7b16e4139b3da72bdff0c9add517351
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sun Apr 21 13:12:58 2013 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Sun Apr 21 22:56:59 2013 +0200

config: check for hash success

Hash insert may fail.

---
 lib/config/config.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
lib/config/config.c +5 -1
index 2c77f30..d1cf590 100644
@@ -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;
+			}
 		}
 	}