diff options
author | Haruna <haru@dotalux.com> | 2015-08-17 17:37:55 +0200 |
---|---|---|
committer | Haruna <haru@dotalux.com> | 2015-08-17 17:37:55 +0200 |
commit | 2f2e04c172a6fde55b1f7f7cf79f66d56894e86f (patch) | |
tree | b00903a5250712c78fef9053590d60857a473e6c /src/common | |
parent | e79efdeee4dd7d2d1632e1703500f9785f962f8f (diff) | |
parent | c31fa9cd48352db8fde5ef91f38bef8ad9507431 (diff) | |
download | hercules-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')
-rw-r--r-- | src/common/malloc.c | 3 |
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; } |