Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leaks. #7

Closed
wants to merge 1 commit into from
Closed

Fix memory leaks. #7

wants to merge 1 commit into from

Conversation

dgoel
Copy link

@dgoel dgoel commented Jan 5, 2017

Here's the valgrind output before the fix:

$ valgrind ./easylzma_test 
==17669== Memcheck, a memory error detector
==17669== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==17669== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==17669== Command: ./easylzma_test
==17669== 
round trip lzma test:    ok
round trip lzip test:    ok
correct lzip test:    ok
lzip as lzma test:    ok
correct lzma test:    ok
lzma as lzip test:    ok
corrupt crc test:    ok
bad lzip size test:    ok
bad lzma size test:    ok
bad lzma size 2 test:    ok

10/10 tests passed
==17669== 
==17669== HEAP SUMMARY:
==17669==     in use at exit: 27,790,268 bytes in 20 blocks
==17669==   total heap usage: 69 allocs, 49 frees, 79,406,342 bytes allocated
==17669== 
==17669== LEAK SUMMARY:
==17669==    definitely lost: 1,319,688 bytes in 8 blocks
==17669==    indirectly lost: 15,718,572 bytes in 11 blocks
==17669==      possibly lost: 10,752,008 bytes in 1 blocks
==17669==    still reachable: 0 bytes in 0 blocks
==17669==         suppressed: 0 bytes in 0 blocks
==17669== Rerun with --leak-check=full to see details of leaked memory
==17669== 
==17669== For counts of detected and suppressed errors, rerun with: -v
==17669== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

And here's the valgrind output after the fix:

$ valgrind ./easylzma_test
==19819== Memcheck, a memory error detector
==19819== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==19819== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==19819== Command: ./test/easylzma_test
==19819== 
round trip lzma test:    ok
round trip lzip test:    ok
correct lzip test:    ok
lzip as lzma test:    ok
correct lzma test:    ok
lzma as lzip test:    ok
corrupt crc test:    ok
bad lzip size test:    ok
bad lzma size test:    ok
bad lzma size 2 test:    ok

10/10 tests passed
==19819== 
==19819== HEAP SUMMARY:
==19819==     in use at exit: 0 bytes in 0 blocks
==19819==   total heap usage: 69 allocs, 69 frees, 79,406,342 bytes allocated
==19819== 
==19819== All heap blocks were freed -- no leaks are possible
==19819== 
==19819== For counts of detected and suppressed errors, rerun with: -v
==19819== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

@dgoel
Copy link
Author

dgoel commented Sep 9, 2021

Closing because author is not responsive.

@dgoel dgoel closed this Sep 9, 2021
fangq added a commit to NeuroJSON/zmat that referenced this pull request Aug 22, 2022
fangq added a commit to NeuroJSON/zmat that referenced this pull request Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant