cap_libv4p.cpp leaks when USE_TEMP_BUFFER is set (Bug #1518)
Description
Version: Latest on 2.3 svn branch
OS: Linux
When USE_TEMP_BUFFER is set (which it is now, at least on this branch) a temp buffer is allocated (malloc), but never freed. This happens at every initialization and became a problem for me in an application that switches alot between to camera resolutions.
I've attached a test program and a patch to fix the problem. The patch makes sure the buffer pointer is null at startup and frees it (and sets it to null) when deinit'ing or if it exists when allocing it.
The problem is very noticable when running valgrind --show-reachable=yes, as the allocated buffers are not reachable any longer.
Let me know if you need any more information to verify.
Associated revisions
fixed memory leak in cap_libv4l.cpp (ticket #1518; thanks to gorgen for the patch)
Merge pull request #1518 from jet47:bug-3291-tbb-install
History
Updated by Vadim Pisarevsky about 13 years ago
thanks! your patch was applied in SVN, r7215
- Status changed from Open to Done
- (deleted custom field) set to fixed
Updated by Andrey Kamaev about 13 years ago
- Target version set to 2.4.0
Updated by Andrey Kamaev over 12 years ago
- Category changed from highgui-images to highgui-video