fix: wrong free
authorceriel <none@none>
Thu, 16 Jul 1987 16:08:13 +0000 (16:08 +0000)
committerceriel <none@none>
Thu, 16 Jul 1987 16:08:13 +0000 (16:08 +0000)
lang/cem/libcc/stdio/fclose.c
lang/cem/libcc/stdio/freopen.c

index 6e3f254..549a9c6 100644 (file)
@@ -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);
 }
 
index 81f233f..dfc2cb5 100644 (file)
@@ -48,7 +48,7 @@ FILE *fp;
                                break;
                        }
                }
-               free(fp);
+               if (fp != &_stdin && fp != &_stdout && fp != &_stderr) free(fp);
                return NULL;
        }