summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}