Fix massive memory leak.