In Chapter 7, Buck spends a long time running with a wolf at one point. The reason that he is happy to run with the wolf is that he is becoming more and more interested in being a wild animal. The old memories (from the distant past, not his own life) are coming back to him and he is feeling the call of the wild.
But for now, John Thornton is still a powerful influence on him. When Buck remembers Thornton, he leaves the wolf and goes back to be with the man who he loves so much.