diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2012-08-17 18:32:56 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2013-02-24 17:58:34 +0100 |
| commit | 1711be955b54b9d12431b341ea290bad406023cc (patch) | |
| tree | 3f667dab7e2ef59aa622035b5d95f4a00ab9b57a /src/base/system.c | |
| parent | 98042012a6c6e639c9736b32518dd082ca539615 (diff) | |
| download | zcatch-1711be955b54b9d12431b341ea290bad406023cc.tar.gz zcatch-1711be955b54b9d12431b341ea290bad406023cc.zip | |
fixed all the errors that the clang static analayzer found
Diffstat (limited to 'src/base/system.c')
| -rw-r--r-- | src/base/system.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/base/system.c b/src/base/system.c index a849e807..410cb699 100644 --- a/src/base/system.c +++ b/src/base/system.c @@ -80,7 +80,7 @@ void dbg_assert_imp(const char *filename, int line, int test, const char *msg) void dbg_break() { - *((unsigned*)0) = 0x0; + *((volatile unsigned*)0) = 0x0; } void dbg_msg(const char *sys, const char *fmt, ...) @@ -166,6 +166,8 @@ void *mem_alloc_debug(const char *filename, int line, unsigned size, unsigned al MEMTAIL *tail; MEMHEADER *header = (struct MEMHEADER *)malloc(size+sizeof(MEMHEADER)+sizeof(MEMTAIL)); dbg_assert(header != 0, "mem_alloc failure"); + if(!header) + return NULL; tail = (struct MEMTAIL *)(((char*)(header+1))+size); header->size = size; header->filename = filename; |