diff options
| -rw-r--r-- | lib/libc/gen/getttyent.c | 9 | 
1 files changed, 4 insertions, 5 deletions
| diff --git a/lib/libc/gen/getttyent.c b/lib/libc/gen/getttyent.c index 2cd965dceab5..5d40ac9941f6 100644 --- a/lib/libc/gen/getttyent.c +++ b/lib/libc/gen/getttyent.c @@ -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; | 
