New answers tagged

0 votes

pset5 speller valgrind test fails

The problem is here: //k->word = word; for(int n = 0; word[n]!='\0'; n++) { k->word[n] = word[n]; } Because the loop will not copy the terminating null byte ...
1 vote

Recover runs, but leaks 472 bytes in 1 block

Whenever valgrind points to an fopen as the source of a memory leak, it almost always means that a file wasn't closed. For each block, it's one file still open. Looking at your code, and knowing the ...
  • 66.2k

Top 50 recent answers are included