Bug 1082346 - magic_load() produces memory leaks
Summary: magic_load() produces memory leaks
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: file
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Kaluža
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-30 13:41 UTC by Tomas Mlcoch
Modified: 2014-07-05 14:53 UTC (History)
1 user (show)

Fixed In Version: file-5.19-1.fc20
Clone Of:
Environment:
Last Closed: 2014-07-05 14:53:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Reproducer (645 bytes, text/x-csrc)
2014-03-30 13:41 UTC, Tomas Mlcoch
no flags Details

Description Tomas Mlcoch 2014-03-30 13:41:52 UTC
Created attachment 880313 [details]
Reproducer

magic_load() produces memory leaks every time it's called.

See the attached reproducer.c

$ make clean && make && valgrind --leak-check=full ./reproducer 
rm -rf reproducer
gcc -Wall -Wextra -lmagic reproducer.c -o reproducer
==25855== Memcheck, a memory error detector
==25855== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==25855== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==25855== Command: ./reproducer
==25855== 
==25855== 
==25855== HEAP SUMMARY:
==25855==     in use at exit: 80 bytes in 4 blocks
==25855==   total heap usage: 24 allocs, 20 frees, 1,900 bytes allocated
==25855== 
==25855== 40 bytes in 1 blocks are definitely lost in loss record 2 of 3
==25855==    at 0x4C291D4: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==25855==    by 0x4E39BD8: file_apprentice (in /usr/lib64/libmagic.so.1.0.0)
==25855==    by 0x400929: main (in /home/tojaj/magic_file_reproducer/reproducer)
==25855== 
==25855== 40 bytes in 1 blocks are definitely lost in loss record 3 of 3
==25855==    at 0x4C291D4: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==25855==    by 0x4E3921A: ??? (in /usr/lib64/libmagic.so.1.0.0)
==25855==    by 0x4E39E4E: file_apprentice (in /usr/lib64/libmagic.so.1.0.0)
==25855==    by 0x400929: main (in /home/tojaj/magic_file_reproducer/reproducer)
==25855== 
==25855== LEAK SUMMARY:
==25855==    definitely lost: 80 bytes in 2 blocks
==25855==    indirectly lost: 0 bytes in 2 blocks
==25855==      possibly lost: 0 bytes in 0 blocks
==25855==    still reachable: 0 bytes in 0 blocks
==25855==         suppressed: 0 bytes in 0 blocks
==25855== 
==25855== For counts of detected and suppressed errors, rerun with: -v
==25855== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 2 from 2)

Comment 1 Jan Kaluža 2014-06-27 12:07:35 UTC
This is fixed in file-5.19 in rawhide.

Comment 2 Fedora Update System 2014-07-01 13:45:08 UTC
file-5.19-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/file-5.19-1.fc20

Comment 3 Fedora Update System 2014-07-01 23:32:48 UTC
Package file-5.19-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing file-5.19-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-7992/file-5.19-1.fc20
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2014-07-05 14:53:13 UTC
file-5.19-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.