Fix potential memory leak.