Text  |   XML   |   Visible Warnings:

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

Categories: ALLOC.LEAK CWE:401 CWE:771 CWE:773
Warning ID: 456.29215
Procedure: trc_open_output_file
Trace: view
Modified: Thu Nov 26 11:36:13 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_open_output_file
 305 trc_open_output_file( ID ) 
 306 TRC_ID ID;
 307 {
 308         int fd;
 309  
 310         /* Close Any Existing Output File */ 
 311  
 312         if ( ID->output_fp != NULL && ID->output_fp != stdout )
 313                 fclose( ID->output_fp );
 314  
 315         /* Verify Output File Set */ 
 316  
 317         if ( ID->output_file == NULL )
 318         {
 319                 trc_status_msg( ID, "Output File Has Not Been Set." );
 320  
 321                 return( TRC_FALSE );
 322         }
 323  
 324         /* Open Output File */ 
 325  
 326         if ( strcmp( ID->output_file, "" ) )
 327         {
referenced by returned value328                 fd = open( ID->output_file, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0600 );     /* Leak */
 329  
referenced by fd330                 if ( !trc_fdcheck( fd, ID->output_file ) )
 331                         return( TRC_FALSE );
 332  
 333                 ID->output_fp = fdopen( fd, "w" );
 334  
 335                 if ( !trc_filecheck( ID->output_fp, ID->output_file ) )
 336                         return( TRC_FALSE );
 337         }
 338  
 339         else 
 340                 ID->output_fp = stdout;
 341  
 342         /* Successful Opening */ 
 343  
 344         return( TRC_TRUE );
 345 } 
Preconditions
ID->output_fp = 0
Postconditions
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
errno' != 0




Change Warning 456.29215 : Leak

Priority:
State:
Finding:
Owner:
Note: