The DnD warlock functions almost exactly opposite of how the WoW warlock works both mechanically and lore wise.
In WoW warlocks are basically mages who tapped into a corruptive energy called fel and use it to enslave demons to their will.
In DnD warlocks are mages who decided to take a short cut to greater power and made a pact with a greater being so they could learn dark magical secrets and leech power off their patron.
The flavor is similar in that you're an unholy wielder of demonic power (if you choose Fiend as your pact) but different in that WoW warlocks become the evil master while DnD warlocks become a willing servant to boost themselves.