svn commit: r269326 - head/lib/libc/stdio

Nick Hibma n_hibma at FreeBSD.org
Thu Jul 31 08:28:43 UTC 2014


Author: n_hibma
Date: Thu Jul 31 08:28:42 2014
New Revision: 269326
URL: http://svnweb.freebsd.org/changeset/base/269326

Log:
  Fix the example: free the memory that was allocated by getline().

Modified:
  head/lib/libc/stdio/getline.3

Modified: head/lib/libc/stdio/getline.3
==============================================================================
--- head/lib/libc/stdio/getline.3	Thu Jul 31 08:07:23 2014	(r269325)
+++ head/lib/libc/stdio/getline.3	Thu Jul 31 08:28:42 2014	(r269326)
@@ -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


More information about the svn-src-head mailing list