svn commit: r291574 - stable/9/lib/libc/stdio

Garrett Cooper ngie at FreeBSD.org
Tue Dec 1 07:33:32 UTC 2015


Author: ngie
Date: Tue Dec  1 07:33:30 2015
New Revision: 291574
URL: https://svnweb.freebsd.org/changeset/base/291574

Log:
  MFstable/10 r291572:
  
  MFC r269326:
  r269326 (by n_hibma):
  
  Fix the example: free the memory that was allocated by getline().

Modified:
  stable/9/lib/libc/stdio/getline.3
Directory Properties:
  stable/9/   (props changed)
  stable/9/lib/   (props changed)
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/stdio/getline.3
==============================================================================
--- stable/9/lib/libc/stdio/getline.3	Tue Dec  1 07:32:35 2015	(r291573)
+++ stable/9/lib/libc/stdio/getline.3	Tue Dec  1 07:33:30 2015	(r291574)
@@ -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-stable mailing list