Solve a potential memory leak, and reuse one buffer for the task.