on errors, buff needs to be freed
Merge pull request #515 from DBarney/master

on errors, buff needs to be freed