Plug the memory leak.  Greater ambitions to improve this routine are proving
more difficult than expected.