X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Ffclose.c;fp=functions%2Fstdio%2Ffclose.c;h=bc8d852e4d378f4ceb8d154cba1cc18c4e5852aa;hb=e8926c894a96724d9aff95e364fc2327393550d0;hp=945241318afe09c8012d812412621ba50e13338c;hpb=9fd5c3ead20a941c1a8f8e40bf9f32519c226358;p=pdclib diff --git a/functions/stdio/fclose.c b/functions/stdio/fclose.c index 9452413..bc8d852 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 ) ) {