1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-29 22:00:58 +02:00
Antonio Ospite d3958ab4ed x11grab: fix a memory leak exposed by valgrind
When using "-f x11grab -i :0.0" valgrind reports a definitely lost
memory block with this message:

==31544== 5 bytes in 1 blocks are definitely lost in loss record 1 of 2
==31544==    at 0x4026E68: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31544==    by 0x4026F17: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31544==    by 0x60D399A: av_malloc (in /usr/lib/x86_64-linux-gnu/libavutil.so.51.22.1)
==31544==    by 0x60D3A70: av_strdup (in /usr/lib/x86_64-linux-gnu/libavutil.so.51.22.1)
==31544==    by 0x4A2BE58: ??? (in /usr/lib/x86_64-linux-gnu/libavdevice.so.53.2.0)
==31544==    by 0x506D29E: avformat_open_input (in /usr/lib/x86_64-linux-gnu/libavformat.so.53.21.0)
==31544==    by 0x400A80: main (in /home/ao2/WIP/am7xxx-play/tests/a.out)

The 5 bytes lost are the ones from param = av_strdup(":0.0"), so let's
free param in the exit path.

Also check the av_strdup() return value.

Note: calling av_free(param) even when av_strdup() fails and param is
NULL is OK and keeps the code simpler without adding another label to
skip av_free().

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-03-16 15:39:33 -07:00
2012-03-09 22:02:49 +01:00
2012-02-23 19:36:16 +01:00
2012-03-15 09:01:18 +01:00
2012-02-29 07:24:34 +01:00
2012-03-02 19:10:29 +01:00
2012-03-12 22:46:56 +01:00
2012-02-23 19:36:16 +01:00
2012-02-23 19:36:16 +01:00
2012-01-21 14:54:31 +01:00

Libav README
------------

1) Documentation
----------------

* Read the documentation in the doc/ directory.

2) Licensing
------------

* See the LICENSE file.
Languages
C 90.3%
Assembly 7.8%
Makefile 1.3%
C++ 0.2%
Objective-C 0.2%
Other 0.1%