Removed malloc usage