Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jul 2014 08:28:42 +0000 (UTC)
From:      Nick Hibma <n_hibma@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269326 - head/lib/libc/stdio
Message-ID:  <201407310828.s6V8Sghg049701@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407310828.s6V8Sghg049701>