Attempt to fix some Coverity detected leaks
Should have fixed some more leaks
Forgot to free one var
Forgot to free ANOTHER var
Merge pull request #59 from Hamcha/master

Free()'d a bunch of stuff on errors