Address a possible resource leak in tests.
Merge branch 'develop' into coverity-scan