{
int ret = 0, added = 0;
ENGINE_PILE tmplate, *fnd;
- CRYPTO_THREAD_write_lock(global_engine_lock);
+
+ if (!CRYPTO_THREAD_write_lock(global_engine_lock))
+ return 0;
if (!(*table))
added = 1;
if (!int_table_check(table, 1))
void engine_table_unregister(ENGINE_TABLE **table, ENGINE *e)
{
- CRYPTO_THREAD_write_lock(global_engine_lock);
+ if (!CRYPTO_THREAD_write_lock(global_engine_lock))
+ /* Can't return a value. :( */
+ return;
if (int_table_check(table, 0))
lh_ENGINE_PILE_doall_ENGINE(&(*table)->piles, int_unregister_cb, e);
CRYPTO_THREAD_unlock(global_engine_lock);
void engine_table_cleanup(ENGINE_TABLE **table)
{
- CRYPTO_THREAD_write_lock(global_engine_lock);
+ if (!CRYPTO_THREAD_write_lock(global_engine_lock))
+ return;
if (*table) {
lh_ENGINE_PILE_doall(&(*table)->piles, int_cleanup_cb_doall);
lh_ENGINE_PILE_free(&(*table)->piles);
return NULL;
}
ERR_set_mark();
- CRYPTO_THREAD_write_lock(global_engine_lock);
+ if (!CRYPTO_THREAD_write_lock(global_engine_lock))
+ goto end;
/*
* Check again inside the lock otherwise we could race against cleanup
* operations. But don't worry about a debug printout