summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 255e950)
raw | patch | inline | side by side (parent: 255e950)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 17 Aug 2013 16:55:16 +0000 (18:55 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 17 Aug 2013 16:55:16 +0000 (18:55 +0200) |
When creating a new host object, the services/attributes list are always
initialized to an empty list object. No need to further check this anymore.
This was only required in earlier code when copying a user-provided host
object.
initialized to an empty list object. No need to further check this anymore.
This was only required in earlier code when copying a user-provided host
object.
src/core/store.c | patch | blob | history |
diff --git a/src/core/store.c b/src/core/store.c
index 50991fcea78c244b17eef8e4b0dbbd98acb6ea5a..6deb699024d9b1f90052834efb55d4bcb3abd83a 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
free(SDB_OBJ(new)->name);
SDB_OBJ(new)->name = cname;
- if (! new->attributes) {
- if (! (new->attributes = sdb_llist_create())) {
- char errbuf[1024];
- sdb_log(SDB_LOG_ERR, "store: Failed to initialize "
- "host object '%s': %s", SDB_OBJ(new)->name,
- sdb_strerror(errno, errbuf, sizeof(errbuf)));
- sdb_object_deref(SDB_OBJ(new));
- pthread_rwlock_unlock(&host_lock);
- return -1;
- }
- }
-
- if (! new->services) {
- if (! (new->services = sdb_llist_create())) {
- char errbuf[1024];
- sdb_log(SDB_LOG_ERR, "store: Failed to initialize "
- "host object '%s': %s", SDB_OBJ(new)->name,
- sdb_strerror(errno, errbuf, sizeof(errbuf)));
- sdb_object_deref(SDB_OBJ(new));
- pthread_rwlock_unlock(&host_lock);
- return -1;
- }
- }
-
status = sdb_llist_insert_sorted(host_list, SDB_OBJ(new),
sdb_object_cmp_by_name);