malloc returns 0 on out of memory, not -1 as in version 6.