[#2212] CID49440:

free ptr before it goes out of scope, small refactor to avoid variable
reuse
[#2212] CID49439:

free rodsObjStatOut before it leaves scope
[#2212] CID49437:

freed varMap before it leaves scope
[#2212] CID49435 and CID49438:

Free e and context before they leave scope