From: Florian Krohm Date: Mon, 16 Sep 2013 21:46:31 +0000 (+0000) Subject: VG_(memset) cannot handle NULL pointers and needs to be guarded. X-Git-Tag: svn/VALGRIND_3_9_0~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ffd73f1783edb630962216844b4e82aafeffce7;p=thirdparty%2Fvalgrind.git VG_(memset) cannot handle NULL pointers and needs to be guarded. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13556 --- diff --git a/coregrind/m_mallocfree.c b/coregrind/m_mallocfree.c index 69666bf0eb..8cd324c563 100644 --- a/coregrind/m_mallocfree.c +++ b/coregrind/m_mallocfree.c @@ -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; }