Fixed potential memory leak.