Fix valgrind InvalidRead error
Merge pull request #109 from Metaswitch/issue541

Fix valgrind InvalidRead error