Fix a memory leak in libhsm
Merge pull request #85 from jelu/mem-leak-libhsm-1.4

Mem leak libhsm 1.4