fix memory issue (static analyzer warning, potential null deref).
Merge pull request #139 from mro/master

fix memory issue (static analyzer warning, potential null deref).