Avoid memory leak when unable to allocate stack

Reported by:	Coverity
Avoid adding NULL to the container.

Reported by:	Coverity
Remove unused variable

Reported by:	Coverity
Remove dead code, obj==NULL is checked for earlier.

Reported by:	Coverity
Merge pull request #35 from bdrewery/coverity

Coverity