From: ceriel Date: Thu, 16 Jul 1987 16:08:13 +0000 (+0000) Subject: fix: wrong free X-Git-Tag: release-5-5~4004 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=4804ab14b8f659d355f9ed10c45239d3087dc981;p=ack.git fix: wrong free --- diff --git a/lang/cem/libcc/stdio/fclose.c b/lang/cem/libcc/stdio/fclose.c index 6e3f2549a..549a9c6f4 100644 --- a/lang/cem/libcc/stdio/fclose.c +++ b/lang/cem/libcc/stdio/fclose.c @@ -17,7 +17,7 @@ FILE *fp; close(fileno(fp)); if ( io_testflag(fp,IO_MYBUF) && fp->_buf ) free( fp->_buf ); - free(fp); + if (fp != &_stdin && fp != &_stdout && fp != &_stderr) free(fp); return(NULL); } diff --git a/lang/cem/libcc/stdio/freopen.c b/lang/cem/libcc/stdio/freopen.c index 81f233f49..dfc2cb59f 100644 --- a/lang/cem/libcc/stdio/freopen.c +++ b/lang/cem/libcc/stdio/freopen.c @@ -48,7 +48,7 @@ FILE *fp; break; } } - free(fp); + if (fp != &_stdin && fp != &_stdout && fp != &_stderr) free(fp); return NULL; }