check if _mem is NULL
Merge pull request #207 from attilaz/master

check if _mem is NULL