Change new to mem_alloc (thanks BeaR)