Use safe malloc.