mirror of
				https://git.wownero.com/wownero/RandomWOW.git
				synced 2024-08-15 00:23:14 +00:00 
			
		
		
		
	Fixed cache->jit memory leak
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
This commit is contained in:
		
							parent
							
								
									85c527a623
								
							
						
					
					
						commit
						166e0d80f5
					
				
					 1 changed files with 1 additions and 3 deletions
				
			
		|  | @ -134,9 +134,7 @@ extern "C" { | |||
| 
 | ||||
| 	void randomx_release_cache(randomx_cache* cache) { | ||||
| 		assert(cache != nullptr); | ||||
| 		if (cache->memory != nullptr) { | ||||
| 			cache->dealloc(cache); | ||||
| 		} | ||||
| 		cache->dealloc(cache); | ||||
| 		delete cache; | ||||
| 	} | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue