Skip to content

Commit

Permalink
Fix missing failure check in allocMemoryPages() (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyc committed Jul 24, 2022
1 parent cced5ca commit 261d58c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/virtual_memory.c
Expand Up @@ -144,6 +144,8 @@ void* allocMemoryPages(size_t bytes) {
#define PEXTRA 0
#endif
mem = mmap(NULL, bytes, PAGE_READWRITE | RESERVED_FLAGS | PEXTRA, MAP_ANONYMOUS | MAP_PRIVATE | MEXTRA, -1, 0);
if (mem == MAP_FAILED)
mem = NULL;
#if defined(USE_PTHREAD_JIT_WP) && defined(MAC_OS_VERSION_11_0) \
&& MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0
if (__builtin_available(macOS 11.0, *)) {
Expand Down

0 comments on commit 261d58c

Please sign in to comment.