Fix the example: free the memory that was allocated by getline().
This commit is contained in:
parent
d18aa577d5
commit
500e59c62d
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user