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


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13556 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_mallocfree.c b/coregrind/m_mallocfree.c
index 69666bf..8cd324c 100644
--- a/coregrind/m_mallocfree.c
+++ b/coregrind/m_mallocfree.c
@@ -2200,7 +2200,8 @@
 
    p = VG_(arena_malloc) ( aid, cc, size );
 
-   VG_(memset)(p, 0, size);
+   if (p != NULL)
+     VG_(memset)(p, 0, size);
 
    return p;
 }