I've found the error.

I should have used
Code:
head->docNum = new NodeSmall;
instead of
Code:
NodeSmall *docNum = new NodeSmall;