-.\" $OpenBSD: getdelim.3,v 1.2 2015/09/10 14:00:14 schwarze Exp $
+.\" $OpenBSD: getdelim.3,v 1.3 2015/10/07 16:53:00 millert Exp $
.\" $NetBSD: getdelim.3,v 1.9 2011/04/20 23:37:51 enami Exp $
.\"
.\" Copyright (c) 2009 The NetBSD Foundation, Inc.
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: September 10 2015 $
+.Dd $Mdocdate: October 7 2015 $
.Dt GETDELIM 3
.Os
.Sh NAME
.Xr free 3
.Fa *lineptr .
.Fn getdelim
-ensures that
+will
+.Xr realloc 3
.Fa *lineptr
-is large enough to hold the input, updating
+as necessary, updating
.Fa *n
to reflect the new size.
+It is the responsibility of the caller to
+.Xr free 3
+.Fa *lineptr
+when it is no longer needed.
.Pp
The
.Fn getline
while ((linelen = getline(\*[Am]line, \*[Am]linesize, fp)) != -1)
fwrite(line, linelen, 1, stdout);
+free(line);
if (ferror(fp))
perror("getline");
.Ed