These 3 lines should actually be:

char* token = NULL;
char* settingLine = NULL;
char* toFree = NULL;