Fix reference leaks introduced by the patch for issue #5308.
1 file changed