Fix memory leak - free line buffer