stdio/fclose.c: reset _buf
- if the stream gets freopen()ed, avoid buffer being seen as valid
This commit is contained in:
parent
515e8d075f
commit
09569d399f
1 changed files with 1 additions and 0 deletions
|
@ -25,6 +25,7 @@ fclose(FILE *fp)
|
|||
if (_close(fileno(fp))) retval = EOF;
|
||||
if ( io_testflag(fp,_IOMYBUF) && fp->_buf )
|
||||
free((void *)fp->_buf);
|
||||
fp->_buf = NULL;
|
||||
if (fp != stdin && fp != stdout && fp != stderr)
|
||||
free((void *)fp);
|
||||
return retval;
|
||||
|
|
Loading…
Reference in a new issue