- Use MAP_FAILED error code for check whether mmap() was successful
- Replace various malloc() with Z_Malloc - Fix several memory leaks when VM compilation failed and Com_Error is called - Make failed mmap/VirtualAlloc/malloc calls fatal
This commit is contained in:
1 parent
5e0d0efd2e
commit
544a1c0c1a
5 files changed
+50
-27
No files matched your search
@@ -1427,7 +1427,7 @@ static void sparc_compute_code(vm_t *vm, struct func_info * const fp)
|
||||
|
||||
data_and_code = mmap(NULL, code_length, PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED | MAP_ANONYMOUS, -1, 0);
|
||||
if (!data_and_code)
|
||||
if (data_and_code == MAP_FAILED)
|
||||
DIE("Not enough memory");
|
||||
|
||||
code_now = code_begin = (unsigned int *)
|
||||
|
||||
Reference in new issue
Block a user