summaryrefslogtreecommitdiff
path: root/src/common/malloc.c
diff options
context:
space:
mode:
authorHaruna <haru@dotalux.com>2015-08-17 17:37:55 +0200
committerHaruna <haru@dotalux.com>2015-08-17 17:37:55 +0200
commit2f2e04c172a6fde55b1f7f7cf79f66d56894e86f (patch)
treeb00903a5250712c78fef9053590d60857a473e6c /src/common/malloc.c
parente79efdeee4dd7d2d1632e1703500f9785f962f8f (diff)
parentc31fa9cd48352db8fde5ef91f38bef8ad9507431 (diff)
downloadhercules-2f2e04c172a6fde55b1f7f7cf79f66d56894e86f.tar.gz
hercules-2f2e04c172a6fde55b1f7f7cf79f66d56894e86f.tar.bz2
hercules-2f2e04c172a6fde55b1f7f7cf79f66d56894e86f.tar.xz
hercules-2f2e04c172a6fde55b1f7f7cf79f66d56894e86f.zip
Merge pull request #654 from 4144/memfixes
Different memory corruption fixes
Diffstat (limited to 'src/common/malloc.c')
-rw-r--r--src/common/malloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/malloc.c b/src/common/malloc.c
index d5a979e77..63de90cb3 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -343,7 +343,8 @@ void *mmalloc_(size_t size, const char *file, int line, const char *func) {
void *mcalloc_(size_t num, size_t size, const char *file, int line, const char *func) {
void *p = iMalloc->malloc(num * size,file,line,func);
- memset(p,0,num * size);
+ if (p)
+ memset(p, 0, num * size);
return p;
}