Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Leak  at trcutil.c:222

Categories: ALLOC.LEAK CWE:401 CWE:771 CWE:773
Warning ID: 22171.29217
Procedure: trc_reset_trace_file
Trace: view
Modified: Thu Nov 26 11:36:15 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
ProblemLineSource
   /kat0/fletcher/SATE/2010/pvm3/tracer/trcutil.c
   Enter trc_reset_trace_file
 188 trc_reset_trace_file( ID ) 
 189 TRC_ID ID;
 190 {
 191         TRC_TEVDESC TD;
 192  
 193         int fd;
 194         int i;
 195  
 196         /* Close Any Existing Trace File */ 
 197  
 198         if ( ID->trace_out != NULL && ID->trace_out != stdout )
 199                 fclose( ID->trace_out );
 200  
 201         /* Clean Up Any Leftover Tasks */ 
 202  
 203         trc_free_tevtask_list( &(ID->tevtask_list) );
 204  
 205         /* Clean Up Any Dead Hosts */ 
 206  
 207         trc_cleanup_dead_hosts();
 208  
 209         /* Verify Trace File Set */ 
 210  
 211         if ( ID->trace_file == NULL )
 212         {
 213                 trc_status_msg( ID, "Trace File Has Not Been Set." );
 214  
 215                 return( TRC_FALSE );
 216         }
 217  
 218         /* Open Trace File */ 
 219  
 220         if ( strcmp( ID->trace_file, "" ) )
 221         {
referenced by returned value222                 fd = open( ID->trace_file, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0600 );     /* Leak */
 223  
referenced by fd224                 if ( !trc_fdcheck( fd, ID->trace_file ) )
 225                         return( TRC_FALSE );
 226  
 227                 ID->trace_out = fdopen( fd, "w" );
 228  
 229                 if ( !trc_filecheck( ID->trace_out, ID->trace_file ) )
 230                         return( TRC_FALSE );
 231         }
 232  
 233         else 
 234                 ID->trace_out = stdout;
 235  
 236         /* Dump Initial Trace File Header */ 
 237  
 238         trc_dump_trace_header( ID );
 239  
 240         /* Reset Event Name Lookup Trie */ 
   ...
 267  
 268         trc_reset_old_descriptors();
 269  
 270         /* Set Trace File Complete Flag */ 
 271  
 272         ID->complete = TRC_FALSE;
 273  
 274         /* Successful Reset */ 
 275  
 276         return( TRC_TRUE );
 277 } 
Preconditions
ID->tevtask_list >= 0
ID->trace_out = 0
TRC_HOST_LIST >= 0
Postconditions
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
errno' != 0




Change Warning 22171.29217 : Leak

Priority:
State:
Finding:
Owner:
Note: