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:
Joerg Wunsch 1996-12-12 23:52:34 +00:00
parent 35aa820e35
commit 4e17605909

View File

@ -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;