fix error for missing malloc.h under macosx (thanks to Erik)