X-Git-Url: https://pd.if.org/git/?p=pdclib.old;a=blobdiff_plain;f=functions%2Fstdio%2Ffclose.c;h=37349c06881b98291e8a824c30b6d3c808ba3c2a;hp=945241318afe09c8012d812412621ba50e13338c;hb=35d48051496adf237dcd22ff1324e93b6f351284;hpb=0e35e82c5e9a0804864839e8fc0e985b1ae41f07 diff --git a/functions/stdio/fclose.c b/functions/stdio/fclose.c index 9452413..37349c0 100644 --- a/functions/stdio/fclose.c +++ b/functions/stdio/fclose.c @@ -55,6 +55,11 @@ int fclose( FILE * stream ) { remove( stream->filename ); } + /* Free user buffer (SetVBuf allocated) */ + if ( stream->status & _PDCLIB_FREEBUFFER ) + { + free( stream->buffer ); + } /* Free stream */ if ( ! ( stream->status & _PDCLIB_STATIC ) ) {