Date: Tue, 1 Dec 2015 07:16:06 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291572 - stable/10/lib/libc/stdio Message-ID: <201512010716.tB17G6Xl044084@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512010716.tB17G6Xl044084>