]> pd.if.org Git - pdclib/blobdiff - functions/stdio/fclose.c
Removed SVN keyword tags.
[pdclib] / functions / stdio / fclose.c
index 945241318afe09c8012d812412621ba50e13338c..8808171e745f84c67c28ed2b7f97316d65dbda92 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /* fclose( FILE * )
 
    This file is part of the Public Domain C Library (PDCLib).
@@ -55,6 +53,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 ) )
             {