pombreda / libarchive

Automatically exported from code.google.com/p/libarchive
Other
0 stars 0 forks source link

memory leak in __archive_read_get_extract #409

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The latest git code of libarchive (not reproducible in latest release) has a 
memory leak. It seems the variable extract (line 100, archive_read_extract2.c) 
is never free'd.

Seems to happen independent of the archive used, just bsdtar -xf on a random 
file.

valgrind output:
==6850== HEAP SUMMARY:
==6850==     in use at exit: 24 bytes in 1 blocks
==6850==   total heap usage: 91 allocs, 90 frees, 133,036 bytes allocated
==6850== 
==6850== 24 bytes in 1 blocks are definitely lost in loss record 1 of 1
==6850==    at 0x4C29F80: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6850==    by 0x416E1C: __archive_read_get_extract (archive_read_extract2.c:53)
==6850==    by 0x417070: archive_read_extract_set_progress_callback 
(archive_read_extract2.c:100)
==6850==    by 0x408425: read_archive (read.c:226)
==6850==    by 0x408666: tar_mode_x (read.c:104)
==6850==    by 0x4067B3: main (bsdtar.c:805)

Original issue reported on code.google.com by hanno@hboeck.de on 13 Feb 2015 at 7:36

GoogleCodeExporter commented 9 years ago
Thank you!

I believe this is fixed in git commit d24e79e

Original comment by kientzle@gmail.com on 14 Feb 2015 at 4:23