Yes, it's correct.
There are quite a few discussions about this point. I think the confusion comes from the fact that most people focus on the verb, which isn't the issue.
'Him' can be used as the dative pronoun without a preposition, as pronouns used to be used in declensional languages.
Ie. it is perfectly correct (if antiquated) to say: 'I gave it him'.
Matat