Skip to content

Commit

Permalink
Add error handling to malloc as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Thilo Schulz committed May 9, 2011
1 parent 2e3c902 commit 36314a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/qcommon/vm_x86.c
Expand Up @@ -1104,6 +1104,8 @@ void VM_Compile( vm_t *vm, vmHeader_t *header ) {
Com_Error(ERR_FATAL, "VM_CompileX86: VirtualAlloc failed");
#else
vm->codeBase = malloc(compiledOfs);
if(!vm->codeBase)
Com_Error(ERR_FATAL, "VM_CompileX86: malloc failed");
#endif

Com_Memcpy( vm->codeBase, buf, compiledOfs );
Expand Down

0 comments on commit 36314a1

Please sign in to comment.