malloc.h is nonstandard, use stdlib.h