make it easier for coverity to understand this code (there are no resource leaks)

This commit is contained in:
Enno Rehling 2015-11-05 12:47:34 +01:00
parent 05239659c8
commit dcc819491f
2 changed files with 5 additions and 2 deletions

@ -1 +1 @@
Subproject commit 77130e660e2227ae740e06f38e85cd18ff728599
Subproject commit dfe57a077222c6b572da61a79dc0687f81c10055

View File

@ -2981,7 +2981,10 @@ spellbook * get_spellbook(const char * name)
result = create_spellbook(name);
assert(strlen(name) + sizeof(result) < sizeof(buffer));
len = cb_new_kv(name, len, &result, sizeof(result), buffer);
cb_insert(&cb_spellbooks, buffer, len);
if (cb_insert(&cb_spellbooks, buffer, len) == CB_EXISTS) {
log_error("cb_insert failed although cb_find returned nothing for spellbook=%s", name);
assert(!"should not happen");
}
}
return result;
}