correctly freeing line after allocation, though shows some of the errors that can be produced when using strintok, recommend using strdup first in future