Fixed reported memory leak in debug build.