g4klx / MMDVM

The firmware for the MMDVM (Multi-Mode Digital Voice Modem)
GNU General Public License v2.0
473 stars 188 forks source link

Fix for Ack/Callsign corruption in FM branch #228

Closed m0vse closed 4 years ago

m0vse commented 4 years ago

In the new FM branch, I noticed that every time I restarted MMDVMHost without rebooting the MMDVM, the callsign and ack was added to the existing rather than replacing them.

The simple fix was to set m_poLen = 0 at the beginning of setParams() in FMKeyer.cpp as otherwise subsequent calls to setParams() start at the end of any current data.

I also noticed that each invocation of setParams() will create a new m_audio array, which I suspect causes a memory leak so I have added a delete[]. The same function in FMCTCSSTX.cpp also has this issue I think.