HT_SET_KEY_STRING_CASE(&key, name, name);
val.value = (void *)(intptr_t)number;
ret = ossl_ht_insert(namemap->namenum_ht, TO_HT_KEY(&key), &val, NULL);
- if (!ossl_assert(ret != 0)) /* cannot happen as we are under write lock */
- return 0;
- if (ret < 1) {
- /* unable to insert due to too many collisions */
- ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_NAMES);
+ if (ret <= 0) {
+ /*
+ * We either got an allocation failure (INTERNAL_ERROR), or
+ * hit too many conflicts in the table (TOO_MANY_NAMES)
+ */
+ ERR_raise(ERR_LIB_CRYPTO, (ret < 0) ? CRYPTO_R_TOO_MANY_NAMES : ERR_R_INTERNAL_ERROR);
return 0;
}
return number;