Fix a memory leak in libhsm
Merge pull request #84 from jelu/mem-leak-libhsm-1.3

Mem leak libhsm 1.3