fix a long standing memory leak (the worst of them