torognes / swarm

A robust and fast clustering method for amplicon-based studies
GNU Affero General Public License v3.0
123 stars 23 forks source link

small memory leak when using the --log option #124

Closed frederic-mahe closed 5 years ago

frederic-mahe commented 5 years ago

Note the difference when using the --log option or not (no --fastidious option):

valgrind ./swarm -o /dev/null <(printf ">s1_10\nAA\n>s2_1\nCC\n") -l /dev/null 
==2084== HEAP SUMMARY:
==2084==     in use at exit: 552 bytes in 1 blocks
==2084==   total heap usage: 28 allocs, 27 frees, 5,399,504 bytes allocated

valgrind ./swarm -o /dev/null <(printf ">s1_10\nAA\n>s2_1\nCC\n")
==2094== HEAP SUMMARY:
==2094==     in use at exit: 0 bytes in 0 blocks
==2094==   total heap usage: 26 allocs, 26 frees, 5,394,856 bytes allocated
==2094== 
==2094== All heap blocks were freed -- no leaks are possible

There is a small memory leak when using the --log option (1 allocation is not freed).

frederic-mahe commented 5 years ago

Now covered by a unit test (see commit 70503611b57d947aab416218b3598c4d1766f168).

frederic-mahe commented 5 years ago

fixed by commit 6edcf8eff09da51388e8c4c633da82621eeb5554