New answers tagged valgrind
0
votes
Accepted
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 ...
- 27.5k
1
vote
Accepted
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
Related Tags
valgrind × 221pset5 × 145
speller × 100
memory-leak × 37
unload × 26
pset4 × 24
load × 22
memory × 17
cs50x × 16
recover × 15
dictionary × 15
check50 × 13
segmentation-fault × 13
c × 12
trie × 12
pset6 × 9
free × 9
error × 8
check × 5
malloc × 5
server × 3
pointers × 3
resize × 2
hash-table × 2
fails-check50-but-works × 2