- 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
@@ -1837,7 +1837,7 @@ PPC_ComputeCode( vm_t *vm )
|
||||
unsigned char *dataAndCode = mmap( NULL, codeLength,
|
||||
PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, -1, 0 );
|
||||
|
||||
if ( ! dataAndCode )
|
||||
if (dataAndCode == MAP_FAILED)
|
||||
DIE( "Not enough memory" );
|
||||
|
||||
ppc_instruction_t *codeNow, *codeBegin;
|
||||
|
||||
Reference in new issue
Block a user