fix result set memory leak