At this point:
for(i = 0; i < wordLine ; i++)
wordLine
= 0, so no memory will be allocated. I think it should be:
for(i = 0; i < numberOfLines; i++)
And you need to set numberOfChars
= 0, similar to what Grijesh Chauhan said, otherwise you'll allocate too much memory.