From: Owen Shepherd Date: Mon, 21 Jul 2014 13:49:21 +0000 (+0100) Subject: Merge X-Git-Url: https://pd.if.org/git/?p=pdclib;a=commitdiff_plain;h=072f30583aa781ac40faeff08500f0dadf7cf1de;hp=abe63836320730ecf705e5da9c140db4c216cd2c Merge --- 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 ) ) {