projects
/
fw
/
pdclib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Bug #39: fclose( stdout ) corrupts memory
[fw/pdclib]
/
functions
/
stdio
/
fclose.c
diff --git
a/functions/stdio/fclose.c
b/functions/stdio/fclose.c
index 2b686946c2f55ed9f5d594cec18b579dbccfb7a9..5c1e4d44d96c0b44e44a990468f25b32c3159769 100644
(file)
--- a/
functions/stdio/fclose.c
+++ b/
functions/stdio/fclose.c
@@
-49,8
+49,10
@@
int fclose( struct _PDCLIB_file_t * stream )
remove( stream->filename );
}
/* Free stream */
- free( stream );
-
+ if ( ! stream->status & _PDCLIB_STATIC )
+ {
+ free( stream );
+ }
return 0;
}
previous = current;