Changeset c9a4da01 in rtems
- Timestamp:
- 11/26/03 17:53:30 (20 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- d16b2d3
- Parents:
- 690861c
- Location:
- cpukit/libcsupport
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libcsupport/ChangeLog
r690861c rc9a4da01 1 2003-11-26 Joel Sherrill <joel@OARcorp.com> 2 3 PR 524/filesystem 4 * src/newlibc.c: Address 1K buffer leak from incomplete cleanup of 5 newlib reentrancy handler. 6 1 7 2003-11-26 Joel Sherrill <joel@OARcorp.com> 2 8 -
cpukit/libcsupport/src/newlibc.c
r690861c rc9a4da01 42 42 43 43 #include <stdio.h> 44 45 int _fwalk(struct _reent *ptr, int (*function) (FILE *) ); 44 46 45 47 int libc_reentrant; /* do we think we are reentrant? */ … … 197 199 */ 198 200 201 int newlib_free_buffers( 202 FILE *fp 203 ) 204 { 205 switch ( fileno(fp) ) { 206 case 0: 207 case 1: 208 case 2: 209 if (fp->_flags & __SMBF) { 210 free( fp->_bf._base ); 211 fp->_flags &= ~__SMBF; 212 fp->_bf._base = fp->_p = (unsigned char *) NULL; 213 } 214 break; 215 default: 216 fclose(fp); 217 } 218 return 0; 219 } 220 199 221 rtems_extension libc_delete_hook( 200 222 rtems_tcb *current_task, … … 216 238 /* if (ptr) */ 217 239 if (ptr && ptr != &libc_global_reent) { 240 /* 218 241 _wrapup_reent(ptr); 219 242 _reclaim_reent(ptr); 243 */ 244 /* 245 * Just in case there are some buffers lying around. 246 */ 247 _fwalk(ptr, newlib_free_buffers); 220 248 #if REENT_MALLOCED 221 249 free(ptr);
Note: See TracChangeset
for help on using the changeset viewer.