Free resources in an error case.

CID:		1018947
Found with:	Coverity Prevent(tm)
MFC after:	1 week