diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-17 17:01:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-17 17:01:40 +0300 |
commit | 9e6e0e0790c6548e45eda36d7699fea51502970d (patch) | |
tree | b653f0ab245ec5e9de3a2f5066978bf9287f2689 /src | |
parent | e79efdeee4dd7d2d1632e1703500f9785f962f8f (diff) | |
download | hercules-9e6e0e0790c6548e45eda36d7699fea51502970d.tar.gz hercules-9e6e0e0790c6548e45eda36d7699fea51502970d.tar.bz2 hercules-9e6e0e0790c6548e45eda36d7699fea51502970d.tar.xz hercules-9e6e0e0790c6548e45eda36d7699fea51502970d.zip |
Dont call memset with null pointer.
Diffstat (limited to 'src')
-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; } |