Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Dec 2015 07:33:31 +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-9@freebsd.org
Subject:   svn commit: r291574 - stable/9/lib/libc/stdio
Message-ID:  <201512010733.tB17XV9m049764@repo.freebsd.org>

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



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