[FFmpeg-devel] [PATCH] ffprobe: free string_validation_replacement.

Stefano Sabatini stefasab at gmail.com
Tue Dec 3 21:41:29 CET 2013


On date Tuesday 2013-12-03 18:44:29 +0100, Michael Niedermayer encoded:
> Fixes memleak in fate tests
> 
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  ffprobe.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/ffprobe.c b/ffprobe.c
> index 43f830b..7d5a2b5 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -364,6 +364,7 @@ static void writer_close(WriterContext **wctx)
>      if ((*wctx)->writer->priv_class)
>          av_opt_free((*wctx)->priv);
>      av_freep(&((*wctx)->priv));
> +    av_freep(&(*wctx)->string_validation_replacement);
>      av_freep(wctx);
>  }

Fixed differently, thanks.

valgrind --tool=memcheck --leak-check=full --show-reachable=yes --verbose --track-origins=yes ffprobe_g tests/lena.pnm  -show_streams

==22461== 
==22461== HEAP SUMMARY:
==22461==     in use at exit: 184 bytes in 4 blocks
==22461==   total heap usage: 78 allocs, 74 frees, 531,444 bytes allocated
==22461== 
==22461== Searching for pointers to 4 not-freed blocks
==22461== Checked 9,126,896 bytes
==22461== 
==22461== 32 bytes in 1 blocks are still reachable in loss record 1 of 4
==22461==    at 0x4C2ABB4: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22461==    by 0x4E356AF: _dlerror_run (dlerror.c:141)
==22461==    by 0x4E350C0: dlopen@@GLIBC_2.2.5 (dlopen.c:87)
==22461==    by 0xC40D06C: ??? (in /usr/lib/libtbb.so.2)
==22461==    by 0xC415483: ??? (in /usr/lib/libtbb.so.2)
==22461==    by 0xC4168E4: ??? (in /usr/lib/libtbb.so.2)
==22461==    by 0xC409602: ??? (in /usr/lib/libtbb.so.2)
==22461==    by 0x400F875: call_init.part.0 (dl-init.c:84)
==22461==    by 0x400F92F: _dl_init (dl-init.c:55)
==22461==    by 0x4001689: ??? (in /lib/x86_64-linux-gnu/ld-2.17.so)
==22461==    by 0x2: ???
==22461==    by 0x7FF00019A: ???
==22461== 

==22461== 40 bytes in 1 blocks are still reachable in loss record 2 of 4
==22461==    at 0x4C2A896: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22461==    by 0x4C2A987: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22461==    by 0xF7B8C9: av_malloc (mem.c:94)
==22461==    by 0xB6DAA8: default_lockmgr_cb (utils.c:78)
==22461==    by 0xB77497: ff_lock_avcodec (utils.c:3240)
==22461==    by 0xB707CB: avcodec_open2 (utils.c:1180)
==22461==    by 0x62F84A: avformat_find_stream_info (utils.c:2752)
==22461==    by 0x440249: open_input_file (ffprobe.c:2281)
==22461==    by 0x440561: probe_file (ffprobe.c:2345)
==22461==    by 0x442285: main (ffprobe.c:2943)
==22461== 
==22461== 40 bytes in 1 blocks are still reachable in loss record 3 of 4
==22461==    at 0x4C2A896: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22461==    by 0x4C2A987: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22461==    by 0xF7B8C9: av_malloc (mem.c:94)
==22461==    by 0xB6DAA8: default_lockmgr_cb (utils.c:78)
==22461==    by 0xB7762C: avpriv_lock_avformat (utils.c:3272)
==22461==    by 0x5B565C: ff_tls_init (network.c:71)
==22461==    by 0x634F2A: avformat_network_init (utils.c:4024)
==22461==    by 0x441EEF: main (ffprobe.c:2875)

Can someone explain these ones?

==22461== 
==22461== 72 bytes in 1 blocks are still reachable in loss record 4 of 4
==22461==    at 0x4C2CF8E: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22461==    by 0xB62F35C: vasprintf (vasprintf.c:84)
==22461==    by 0xB610266: asprintf (asprintf.c:35)
==22461==    by 0x4E3554C: dlerror (dlerror.c:99)
==22461==    by 0xC40D1A9: ??? (in /usr/lib/libtbb.so.2)
==22461==    by 0xC415483: ??? (in /usr/lib/libtbb.so.2)
==22461==    by 0xC4168E4: ??? (in /usr/lib/libtbb.so.2)
==22461==    by 0xC409602: ??? (in /usr/lib/libtbb.so.2)
==22461==    by 0x400F875: call_init.part.0 (dl-init.c:84)
==22461==    by 0x400F92F: _dl_init (dl-init.c:55)
==22461==    by 0x4001689: ??? (in /lib/x86_64-linux-gnu/ld-2.17.so)
==22461==    by 0x2: ???
==22461== 
==22461== LEAK SUMMARY:
==22461==    definitely lost: 0 bytes in 0 blocks
==22461==    indirectly lost: 0 bytes in 0 blocks
==22461==      possibly lost: 0 bytes in 0 blocks
==22461==    still reachable: 184 bytes in 4 blocks
==22461==         suppressed: 0 bytes in 0 blocks
==22461== 
==22461== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
--22461-- 
--22461-- used_suppression:      2 dl-hack3-cond-1
==22461== 
==22461== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
-- 
FFmpeg = Fundamentalist & Fancy Mysterious Proud Everlasting Glue


More information about the ffmpeg-devel mailing list