Fix memory leak
Merge pull request #16 from Metaswitch/fix_mem_leak

Fix memory leak