Fixed segmentation fault.

This fix removes segmentation fault that was introduced because modifying
the source code without understanding it properly.
Fix memory leaks found by clang static analyser
Merge branch 'master' of github.com:dhvani-tts/dhvani-tts