First, valgrind flags the file pointer at the fopen call, and also the malloc call to the root pointer. It designates both still reachable in loss record.
Second, since for pset5 I check for an end of a trie branch by if characters[i] == NULL, how should I allocate memory to root and children nodes? Do I need to loop through each child initializing index to NULL like I have for root, or can I just use calloc(1,sizeof(node))
// check for end of word or file
while (c != '\n' && c != EOF);
{
[removed most of the solution code - mod]