fix a test-only leak found by lsan, PR19521