Memory leak within ptpd2 daemon
//////////////////////// Build-time //////////////////////// mkdir -p my-project cd my-project git clone --branch WRLINUX_9_LTS_CVE \ [https://windshare.windriver.com/remote.php/gitsmart/WRLinux-9-LTS-CVE/wrlinux-9] ./wrlinux-9/setup.sh --machines qemux86-64 IMAGE_INSTALL_append += " ntp ntp-dbg ptpd ptpd-dbg" WRTEMPLATE += "feature/valgrind" //////////////////////// Run-time //////////////////////// >>> vi /etc/ntpd.conf server 127.127.1.0 prefer burst iburst minpoll 5 maxpoll 7 disable auth interface ignore wildcard interface listen eth0 tinker panic 0 tos maxdist 32 enable mode7 ------------------------------------------------------------------------------- >>> vi /etc/ptp.conf ptpengine:preset=slaveonly ptpengine:interface=eth0 ptpengine:clock_update_timeout=90 ptpengine:ntp_failover_timeout=0 ptpengine:prefer_ntp=Y clock:no_adjust=Y global:lock_file=/var/lock/ptp.lock global:status_file=/var/run/ptp.status global:log_status=Y global:status_update_interval=1 // *Leak path* ptpengine:ntp_failover=Y ptpengine:panic_mode_ntp=Y ntpengine:enabled=Y ntpengine:control_enabled=Y ------------------------------------------------------------------------------- // PTP daemon-like test >>> /usr/bin/valgrind --tool=massif --tool=memcheck --leak-check=full --show-leak-kinds=all --show-reachable=yes --num-callers=20 --trace-children=yes --track-fds=yes --track-origins=yes /usr/bin/ptpd2 -d 1 -i eth0 -C -c /etc/ptp.conf