Remove unnecessary memory allocation.