Chapter 18 - "Dobby's Reward" - In which Harry tells his story to Dumbledore, McGonagall, Arthur Weasley, and Molly Weasley, Ginny and Lockhart are sent to hospital, Lucius Malfoy arrives with Dobby, and Harry tricks Lucius into freeing Dobby.
Fawkes Lends a Tail
In McGonagall's Office
Harry tells the story of everything that happened in the Chamber of Secrets, including Riddle's use of a diary to enchant Ginny. [Dumbledore] then sends Ginny to the hospital wing with the Weasleys and McGonagall to ask the kitchens for a feast, leaving him with Harry and Ron.
Dobby is Free!
As Lucius Malfoy departs, Harry grabs the diary, wraps it in his dirty sock, and follows. He gives it to Lucius who rips the sock off and furiously threatens Harry, but in the process inadvertently throws the sock to Dobby and frees him. Dobby throws Lucius across the hall and he promptly gets up and storms off for good.