git: 9front

Download patch

ref: e778313180c86a9a3b25b0188b1c5b2f8c3d6b08
parent: e5ca4e6f19c452f16e83a0a7270e076c934eceb4
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Jan 1 06:48:39 EST 2021

sort: fix memory leak (thanks Igor Boehm)

Free the last line that we examine when looping
through the lines in a file.

--- a/sys/src/cmd/sort.c
+++ b/sys/src/cmd/sort.c
@@ -209,6 +209,8 @@
 			free(ol);
 			ol = l;
 		}
+		free(ol->key);
+		free(ol);
 		return;
 	}
 
--