VG_(memset) cannot handle NULL pointers and needs to be guarded.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13556
This commit is contained in:
Florian Krohm 2013-09-16 21:46:31 +00:00
parent 6d15b5deb4
commit 2ffd73f178

View File

@ -2200,7 +2200,8 @@ void* VG_(arena_calloc) ( ArenaId aid, const HChar* cc,
p = VG_(arena_malloc) ( aid, cc, size );
VG_(memset)(p, 0, size);
if (p != NULL)
VG_(memset)(p, 0, size);
return p;
}