tevador / RandomX

Proof of work algorithm based on random code execution
BSD 3-Clause "New" or "Revised" License
1.38k stars 292 forks source link

Fixed cache->jit memory leak #246

Closed SChernykh closed 2 years ago

SChernykh commented 2 years ago
  1. cache->jit = new randomx::JitCompiler(); - succeeds
  2. cache->memory = (uint8_t*)randomx::LargePageAllocator::allocMemory(randomx::CacheSize); - fails
  3. if (cache && cache->memory == nullptr) randomx_release_cache(cache); is executed
  4. randomx_release_cache checks if (cache->memory != nullptr) and does nothing
  5. cache->jit stays allocated