svn commit: r291572 - stable/10/lib/libc/stdio
Garrett Cooper
ngie at FreeBSD.org
Tue Dec 1 07:16:07 UTC 2015
Author: ngie
Date: Tue Dec 1 07:16:05 2015
New Revision: 291572
URL: https://svnweb.freebsd.org/changeset/base/291572
Log:
MFC r269326:
r269326 (by n_hibma):
Fix the example: free the memory that was allocated by getline().
Modified:
stable/10/lib/libc/stdio/getline.3
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/lib/libc/stdio/getline.3
==============================================================================
--- stable/10/lib/libc/stdio/getline.3 Tue Dec 1 06:51:59 2015 (r291571)
+++ stable/10/lib/libc/stdio/getline.3 Tue Dec 1 07:16:05 2015 (r291572)
@@ -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-10
mailing list