Doing SoDB::init() and then SoDB::finish() should cleanup all memory according to the documentation of the latter, but in my case valgrind reported a memory leak.
The problem lies with the instantiation of the realTime SoGlobalField that is not properly deleted. I am not sure why the d'tor needs to be protected, but as it stands it is never called. I have attached a patch that makes the d'tor public and deletes the object in the callback.
I haven't tested this extensively so I don't know if it has any repercussions.