Yeah, I found a way to fix it. Sorry for not being here. I have replaced dynamic line counter increases with line counter and malloc in the beginning of this function. Now I just use int lines_amount = line_counter(workspace_file->filename); workspace_file->flc = malloc(sizeof(char*) * lines_amount);
Thanks for help!