Don't free the line buffer, since getttynam(3) might still reference
it. Closes PR # bin/2196: Bug in src/libc/gen/gettty... Submitted by: davidn@blaze.net.au (David Nugent)
This commit is contained in:
parent
35aa820e35
commit
4e17605909
@ -207,11 +207,10 @@ endttyent()
|
||||
{
|
||||
int rval;
|
||||
|
||||
if (line) {
|
||||
free(line);
|
||||
line = NULL;
|
||||
lbsize = 0;
|
||||
}
|
||||
/*
|
||||
* NB: Don't free `line' because getttynam()
|
||||
* may still be referencing it
|
||||
*/
|
||||
if (tf) {
|
||||
rval = (fclose(tf) != EOF);
|
||||
tf = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user