plug memleak (currently unused func); from Tiago Cunha
upstream: sync with latest changes

Merge branch 'cvs-tracking'