Fixed Coverity issues

pull/226/head
SChernykh 2 years ago
parent 0df11d24f5
commit 1f7c89a95c

@ -382,8 +382,8 @@ RandomX_Hasher_RPC::RandomX_Hasher_RPC(p2pool* pool)
// Init loop user data before running it
GetLoopUserData(&m_loop);
uv_async_init(&m_loop, &m_shutdownAsync, on_shutdown);
uv_async_init(&m_loop, &m_kickTheLoopAsync, nullptr);
uv_async_init_checked(&m_loop, &m_shutdownAsync, on_shutdown);
uv_async_init_checked(&m_loop, &m_kickTheLoopAsync, nullptr);
m_shutdownAsync.data = this;
uv_mutex_init_checked(&m_requestMutex);

@ -775,7 +775,9 @@ bool SideChain::get_outputs_blob(PoolBlock* block, uint64_t total_reward, std::v
int index;
while ((index = work->counter.fetch_sub(1)) >= 0) {
uint8_t view_tag;
work->tmpShares[index].m_wallet->get_eph_public_key(work->txkeySec, static_cast<size_t>(index), eph_public_key, view_tag);
if (!work->tmpShares[index].m_wallet->get_eph_public_key(work->txkeySec, static_cast<size_t>(index), eph_public_key, view_tag)) {
LOGWARN(6, "get_eph_public_key failed at index " << index);
}
}
++work->num_helper_jobs_finished;

@ -232,6 +232,15 @@ void uv_rwlock_init_checked(uv_rwlock_t* lock)
}
}
void uv_async_init_checked(uv_loop_t* loop, uv_async_t* async, uv_async_cb async_cb)
{
const int err = uv_async_init(loop, async, async_cb);
if (err) {
LOGERR(1, "uv_async_init failed, error " << uv_err_name(err));
panic();
}
}
uv_loop_t* uv_default_loop_checked()
{
if (!is_main_thread()) {

@ -60,6 +60,7 @@ typedef RWLock<true> WriteLock;
void uv_cond_init_checked(uv_cond_t* cond);
void uv_mutex_init_checked(uv_mutex_t* mutex);
void uv_rwlock_init_checked(uv_rwlock_t* lock);
void uv_async_init_checked(uv_loop_t* loop, uv_async_t* async, uv_async_cb async_cb);
uv_loop_t* uv_default_loop_checked();
struct UV_LoopCallbackBase
@ -96,7 +97,7 @@ struct UV_LoopUserData
, m_callbacks{}
, m_callbacksToRun{}
{
uv_async_init(m_loop, m_async, async_cb);
uv_async_init_checked(m_loop, m_async, async_cb);
m_async->data = this;
uv_mutex_init_checked(&m_callbacksLock);

Loading…
Cancel
Save