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

Reply via email to