Fixed memory allocation checks.

This commit is contained in:
XMRig 2019-12-25 04:39:21 +07:00
parent ecb46643e2
commit 22eca8e0d5
No known key found for this signature in database
GPG key ID: 446A53638BE94409
9 changed files with 72 additions and 21 deletions

View file

@ -285,6 +285,10 @@ RandomX_ConfigurationBase RandomX_CurrentConfig;
extern "C" {
randomx_cache *randomx_create_cache(randomx_flags flags, uint8_t *memory) {
if (!memory) {
return nullptr;
}
randomx_cache *cache = nullptr;
try {
@ -329,6 +333,10 @@ extern "C" {
}
randomx_dataset *randomx_create_dataset(uint8_t *memory) {
if (!memory) {
return nullptr;
}
auto dataset = new randomx_dataset();
dataset->memory = memory;