Usermode/libc - Exit on heap corruption
[tpg/acess2.git] / Usermode / Libraries / libc.so_src / heap.c
index bdf64de..1c0c7ac 100644 (file)
@@ -94,13 +94,16 @@ EXPORT void *malloc(size_t bytes)
                        //Corrupt Heap\r
                        Heap_Dump();\r
                        _SysDebug("malloc: Corrupt Heap\n");\r
+                       exit(128);\r
                        return NULL;\r
                }\r
                curBlock = (heap_head*)((uintptr_t)curBlock + curBlock->size);\r
        }\r
        \r
        if((uintptr_t)curBlock < (uintptr_t)_heap_start) {\r
+               Heap_Dump();\r
                _SysDebug("malloc: Heap underrun for some reason\n");\r
+               exit(128);\r
                return NULL;\r
        }\r
        \r

UCC git Repository :: git.ucc.asn.au