Issue #21226: fix a ref leak.