From 9e6e0e0790c6548e45eda36d7699fea51502970d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 17 Aug 2015 17:01:40 +0300 Subject: Dont call memset with null pointer. --- src/common/malloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/common') 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; } -- cgit v1.2.3-70-g09d2