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
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to