fixed memory leak in SetKey() and a warning
Merge pull request #48 from jahntheman/master

fixed memory leak in SetKey() and a warning