Fixed list file generation error which was caused by using freed buffer.