xiph / libao

Portable audio output library
GNU General Public License v2.0
72 stars 32 forks source link

Memleak in ao_example.c #3

Closed DerouineauNicolas closed 5 years ago

DerouineauNicolas commented 7 years ago

Hi, I compiled and installed the latest version of libao on a debian machine. Then I compile the example file with gcc -lao -lm ao_example.c. and I ran valgrind ./a.out

Valgrind is reporting memleaks:

==24931== Memcheck, a memory error detector ==24931== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==24931== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info ==24931== Command: ./a.out ==24931== libao example program ==24931== ==24931== HEAP SUMMARY: ==24931== in use at exit: 403,686 bytes in 4,951 blocks ==24931== total heap usage: 6,507 allocs, 1,556 frees, 651,933 bytes allocated ==24931== ==24931== LEAK SUMMARY: ==24931== definitely lost: 176,400 bytes in 1 blocks ==24931== indirectly lost: 0 bytes in 0 blocks ==24931== possibly lost: 151,846 bytes in 4,779 blocks ==24931== still reachable: 75,440 bytes in 171 blocks ==24931== suppressed: 0 bytes in 0 blocks ==24931== Rerun with --leak-check=full to see details of leaked memory ==24931== ==24931== For counts of detected and suppressed errors, rerun with: -v ==24931== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Is this expected ?

nwrkbiz commented 5 years ago

I cannot reproduce the problem...

But i did compile with a slightly different setup using g++.

nwrkbiz commented 5 years ago

I did compile the slighty modified version (check attachment) with following command:

g++ -lao -lm ao_example.cxx

ao_example.cxx.tar.gz