I got Pset5 Speller to work correctly but I am getting a Valgrind error as follows 568 bytes in 1 blocks are still reachable in loss record 1 of 1: (file: dictionary.c, line: 108) for all the words. What could be the problem?
Line 108 is in the load function where I am opening the dictionary
bool load(const char *dictionary)
{
FILE* fp = fopen(dictionary, "r"); #108
........... fclose(fp);
return false;
}
help50 output-
==11836==
==11836== HEAP SUMMARY:
==11836== in use at exit: 568 bytes in 1 blocks
==11836== total heap usage: 367,084 allocs, 367,083 frees, 82,227,504 bytes allocated
==11836==
==11836== LEAK SUMMARY:
==11836== definitely lost: 0 bytes in 0 blocks
==11836== indirectly lost: 0 bytes in 0 blocks
==11836== possibly lost: 0 bytes in 0 blocks
==11836== still reachable: 568 bytes in 1 blocks
==11836== suppressed: 0 bytes in 0 blocks
==11836== Reachable blocks (those to which a pointer was found) are not shown.
==11836== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==11836==
==11836== For counts of detected and suppressed errors, rerun with: -v
==11836== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Sorry, not sure how to help (yet) with this one!