Author: Unknown
Subject: Valgrind errors on Staff solution
Date: Wednesday, 11 Nov 2020, 12:27:24
When I try compressing my decode with the staff solutions and testing with valgrind, I see memory leaks. How is this possible? $ valgrind --leak-check=full --show-leak-kinds=all /c/cs323/Hwk4/encode < decode > /dev/null ==24467== Memcheck, a memory error detector ==24467== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==24467== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info ==24467== Command: /c/cs323/Hwk4/encode ==24467== ==24467== ==24467== HEAP SUMMARY: ==24467== in use at exit: 34,812 bytes in 2 blocks ==24467== total heap usage: 10 allocs, 8 frees, 67,436 bytes allocated ==24467== ==24467== 2,044 bytes in 1 blocks are still reachable in loss record 1 of 2 ==24467== at 0x483CCE8: realloc (vg_replace_malloc.c:834) ==24467== by 0x4017A6: rebuild (table.c:47) ==24467== by 0x401CA4: addCode (table.c:149) ==24467== by 0x4012CD: encode (lzw.c:53) ==24467== by 0x4016D5: main (lzw.c:147)PREV INDEX NEXT