Chris Baldick's The Concise Oxford Dictionary of Literary Terms (second edition. Oxford University Press, 2001) defines free indirect speech as follows:
a manner of presenting the thoughts or utterances of a fictional character as if from that character's point of view by combining grammatical and other features of the character's 'direct speech' with features of the narrator's 'indirect' report.
The quote from Harry Potter and the Chamber of Secrets does not seem to represent speech; it seems to represent Harry Potter's thoughts without the introductory phrase "he thought". In direct discourse, we might have read something like the following:
Harry thought, "I can just see Malfoy strutting around the manor house. Sending the family servant to stop me going back to Hogwarts also sounds exactly like the sort of thing Malfoy would do. Have I been stupid to take Dobby seriously?"
(Other formulations are possible; the above is just an example.)
The version that Rowling actually wrote has several features of direct speech, such as the adverb "just", which reminds us of phrases such "Just look at him" in informal speech, the choice of the verb "strut" (which is derogatory when applied to a person) and the expression "[it] sounded exactly like the sort of thing Malfoy would do" (in which "exactly" suggests a level of certitude that is undercut by the lower precision suggested by "the sort of thing").