libndofdev on mac has leaked memory for ages. Some CF objects are not being released. Further, after digging into the memleaks, I found several other issues:
Unsafe handling of c-strings that compromise system memory
Use of well out-of-date and deprecated Core Foundation APIs and functions (since at least 10.7.
A couple invalid conversions from 32-64 bit transition.
I have fixed all of these and opened a pull request.
Tested and working on MBP 2017 with SpaceMouse Compact 3DX-700059. I didn't monkey with any of the underlying code, so I don't see how these changes would affect other hardware or platforms.