[Reviewer Matt] Fix valgrind issues - significant leak on registration errors and one uninitialized variable

Matt - can you review please.  These are the fixes to the issues that came up when I was hunting memory leaks last week.

Mike