Fixes to leaks and uninitialized conditions flagged by valgrind
Merge pull request #33 from Metaswitch/sto622-updates

[Reviewer Matt] Fixes to leaks and uninitialized conditions flagged by valgrind