.memleak fix by Ronald Bultje. OK'd by Luca.