From 9c75b0e638ba182a996fb4c76aa8d76cfc13b2ee Mon Sep 17 00:00:00 2001 From: n_hibma Date: Thu, 31 Jul 2014 08:28:42 +0000 Subject: Fix the example: free the memory that was allocated by getline(). --- lib/libc/stdio/getline.3 | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/libc') diff --git a/lib/libc/stdio/getline.3 b/lib/libc/stdio/getline.3 index 2161999..05f07d0 100644 --- a/lib/libc/stdio/getline.3 +++ b/lib/libc/stdio/getline.3 @@ -95,6 +95,7 @@ size_t linecap = 0; ssize_t linelen; while ((linelen = getline(&line, &linecap, fp)) > 0) fwrite(line, linelen, 1, stdout); +free(line); .Ed .Sh COMPATIBILITY Many application writers used the name -- cgit v1.1