The original leak came from Ain't It Cool News, who reported on a rumor of what could be the ending of the film, which apparently turned out to be the actual ending. Moviehole recently talked with someone over at Warner Bros. who confirmed that a new ending was filmed in response to the leak.
The third act of the film has been completely changed "because of the internet leak. The ending doesn't resemble the previous one in any shape or form". And more so, the new ending has tested quite well; it's gotten a much better reaction than the 'big reveal' in the script did.
The site's source also said the new ending is, "a complete  from the original film. Works better. Probably not as hard to swallow. Real good though."
to read more about the changed ending.
Terminator Salvation was released May 21st, 2009 and stars Christian Bale, Sam Worthington, Moon Bloodgood, Helena Bonham Carter, Anton Yelchin, Jadagrace, Bryce Dallas Howard, Common. The film is directed by McG.