froze buffer size, removed corresponding malloc+free calls