diff options
Diffstat (limited to 'lib/libc')
-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 2cd965d..5d40ac9 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; |