remove use of deprecated malloc.h (use stdlib.h instead)