From d1a2a4ad9d5b06d7a8f289302695af91d532a694 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 2 Oct 2013 21:54:35 +0200 Subject: [PATCH] store: Make sure not to store duplicate host entries. --- src/core/store.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/store.c b/src/core/store.c index 43a7a6b..19faee4 100644 --- a/src/core/store.c +++ b/src/core/store.c @@ -309,7 +309,10 @@ store_obj(int parent_type, const char *parent_name, } /* TODO: only look into direct children? */ - if (type == SDB_ATTRIBUTE) + if (type == SDB_HOST) + /* make sure that each host is unique */ + old = STORE_OBJ(sdb_store_lookup_in_list(obj_list, type, name)); + else if (type == SDB_ATTRIBUTE) old = STORE_OBJ(sdb_llist_search_by_name(parent_list, name)); else old = STORE_OBJ(sdb_store_lookup_in_list(parent_list, type, name)); -- 2.30.2