Valgrind memcheck in use1/5/2023 I tried using free(n) but it causes a segmentation fault. This code is what I am using to assign some memory to every new word from the dictionary. On line 128 where it is pointing out an error I have: node *n = malloc(sizeof(node)) =21531= ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) =21531= For counts of detected and suppressed errors, rerun with: -v =21531= possibly lost: 0 bytes in 0 blocks =21531= indirectly lost: 0 bytes in 0 blocks =21531= definitely lost: 0 bytes in 0 blocks =21531= at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) =21531= 6,974,856 bytes in 124,551 blocks are still reachable in loss record 1 of 1 Then if I rerun with -v it shows: Could not open -v. =21401= ERROR SUMMARY: 4513263 errors from 4 contexts (suppressed: 0 from 0) =21401= For counts of detected and suppressed errors, rerun with: -v =21401= All heap blocks were freed - no leaks are possible =21401= in use at exit: 0 bytes in 0 blocks Valgrind shows no leaks are possible but lots of errors: =21401= HEAP SUMMARY: My code passes check50 apart from the memory leak section.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |