Remove more references to malloc