In commit da556d7 (store the value of 'camera_dir'), a memory leak
was introduced due to not freeing this memory in context_destroy().
I followed the advice in PR #639 to correct this.
Valgrind was used to find this leak and test for successful fixing.
Config included a 'camera_dir' with two camera config files.
Command ran: valgrind --leak-check=full ./bin/motion -n
Before:
HEAP SUMMARY:
in use at exit: 91,538 bytes in 13 blocks
total heap usage: 4,227 allocs, 4,214 frees, 20,448,321 bytes allocated
126 bytes in 3 blocks are definitely lost in loss record 8 of 11
at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x406A6D: mymalloc (motion.c:3401)
by 0x40D0CF: mystrdup (conf.c:2687)
by 0x40D30C: mystrcpy (conf.c:2664)
by 0x40D30C: copy_string (conf.c:2470)
by 0x40D565: read_camera_dir (conf.c:2883)
by 0x40CA10: conf_process (conf.c:2034)
by 0x40D850: conf_load (conf.c:2236)
by 0x407063: cntlist_create (motion.c:2876)
by 0x407063: motion_startup (motion.c:2930)
by 0x4052B7: main (motion.c:3128)
LEAK SUMMARY:
definitely lost: 126 bytes in 3 blocks
indirectly lost: 0 bytes in 0 blocks
possibly lost: 0 bytes in 0 blocks
still reachable: 91,412 bytes in 10 blocks
suppressed: 0 bytes in 0 blocks
After:
HEAP SUMMARY:
in use at exit: 91,412 bytes in 10 blocks
total heap usage: 4,201 allocs, 4,191 frees, 20,447,579 bytes allocated
LEAK SUMMARY:
definitely lost: 0 bytes in 0 blocks
indirectly lost: 0 bytes in 0 blocks
possibly lost: 0 bytes in 0 blocks
still reachable: 91,412 bytes in 10 blocks
suppressed: 0 bytes in 0 blocks
Motion
Status
The build status from travis-ci for the master branch is:
Description
Motion is a program that monitors the video signal from one or more cameras and is able to detect if a significant part of the picture has changed. Or in other words, it can detect motion.
Documentation
The documentation for Motion is contained within the file motion_guide.html.
The offline version of this file is available in the doc/motion directory. The online version of the motion_guide.html file can be viewed here
In addition to the detailed building instructions included within the guide, the INSTALL file contains abbreviated building instructions.
Resources
Please join the mailing list here
We prefer support through the mailing list because more people will have the benefit from the answers. A archive of mailing list discussions can be viewed here
License
Motion is mainly distributed under the GNU GENERAL PUBLIC LICENSE (GPL) version 2 or later. See the copyright file for a list of all the licensing terms of the various components of Motion.
The file CREDITS lists the many people who have contributed to Motion over the years.
Contributing
Issues and Patches should be submitted via github and include detail descriptions of the issue being addressed as well as any documentation updates that would be needed with the change.