summaryrefslogtreecommitdiff
path: root/src/qcommon
diff options
context:
space:
mode:
authorThilo Schulz <arny@ats.s.bawue.de>2011-05-09 15:40:30 +0000
committerTim Angus <tim@ngus.net>2013-01-09 21:38:37 +0000
commitfd3328453b89f074ff454bc608420968e3a891e9 (patch)
treefad2555d16d913f56f59910f014b0ab7f9c2fba9 /src/qcommon
parentc1555cf88d8ed6d4e1cc3d302148fbaf6cca39a4 (diff)
Add error handling to malloc as well
Diffstat (limited to 'src/qcommon')
-rw-r--r--src/qcommon/vm_x86.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qcommon/vm_x86.c b/src/qcommon/vm_x86.c
index f25be998..afa29d4c 100644
--- a/src/qcommon/vm_x86.c
+++ b/src/qcommon/vm_x86.c
@@ -1105,6 +1105,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 );