Get rid of mallocs, replace with pallocs.