getline.3: Remove unneeded check before free()

The manpage of getline shows an example with an extra NULL pointer check
before it calls free. This is unneeded according to free(3):

     If ptr is NULL, no operation is performed.

This patch removes the "if" check.

See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572508

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Robert Wohlrab 2010-06-12 15:05:02 +02:00 committed by Michael Kerrisk
parent 9f864ad204
commit 7a4a822133
1 changed files with 2 additions and 3 deletions

View File

@ -21,7 +21,7 @@
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\" License.
.TH GETLINE 3 2009-12-05 "GNU" "Linux Programmer's Manual"
.TH GETLINE 3 2010-06-12 "GNU" "Linux Programmer's Manual"
.SH NAME
getline, getdelim \- delimited string input
.SH SYNOPSIS
@ -156,8 +156,7 @@ main(void)
printf("%s", line);
}
if (line)
free(line);
free(line);
exit(EXIT_SUCCESS);
}
.fi