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)
This is fixed in file-5.19 in rawhide.
file-5.19-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/file-5.19-1.fc20
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).
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.