The fix in 4.0.1 for the memory leak in 4.0.0 (bug 329) contains another memory leak (although not as severe as the old one).
Fixed from rev. 2408.