Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Leak  at trcmess.c:539

Categories: ALLOC.LEAK CWE:401 CWE:771 CWE:773
Warning ID: 438.29189
Similar Warnings: 438.29188
Procedure: trc_handle_trace_message
Trace: view
Modified: Thu Nov 26 11:35:43 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/trcmess.c
   Enter trc_handle_trace_message
 377 trc_handle_trace_message( ID, src ) 
 378 TRC_ID ID;
 379 int src;
 380 {
 381         TRC_DATADESC DD;
 382  
 383         TRC_TEVDESC TD;
 384  
 385         TRC_TEVTASK TT;
 386  
 387         TRC_HOST H;
   ...
 404         int tusec;
 405         int tsec;
 406         int ecnt;
 407         int eid;
 408         int tid;
 409         int dt;
 410  
 411         int marker;
 412         int nest;
 413  
 414         ecnt = 0;
 415  
 416         TRC_PVMCKERR( pvm_upkint( &marker, 1, 1 ),
 417                 "Unpacking Trace Message", return( ecnt ) );
 418  
 419         /* Old PVM 3.3 Trace Format */ 
 420  
 421         if ( marker > 0 )   /* Uninitialized Variable (ID: 22167.29198) */
 422         {
 423                 tsec = marker;
 424  
 425                 TRC_PVMCKERR( pvm_upkint( &tusec, 1, 1 ),
 426                         "Event Parse Error", return( ecnt ) );
 427  
 428                 TRC_PVMCKERR( pvm_upkint( &tid, 1, 1 ),
 429                         "Event Parse Error", return( ecnt ) );
 430  
 431                 TRC_PVMCKERR( pvm_upkint( &eid, 1, 1 ),
   ...
 433  
 434                 ecnt += trc_store_old_trace_event( ID, tsec, tusec, tid, eid );   /* Uninitialized Variable (ID: 22166.29197) */
 435  
 436                 return( ecnt );
 437         }
 438  
 439         /* New PVM 3.4 Format */ 
 440  
 441         /* Get Task & Host Info */ 
 442  
 443         TT = trc_get_tevtask_tid( ID, src );
 444  
 445         pvmd_tid = pvm_tidtohost( src );
 446  
 447         if ( !pvmd_tid )
 448                 pvmd_tid = pvm_tidtohost( TRC_TID );
 449  
 450         H = trc_get_host_tid( pvmd_tid );
 451  
 452         /* Set Leftover Event Omit Flag */ 
 453  
 454         omit = ( ID->trace_out == NULL 
 455                 || ( TT != NULL && TRC_TASK_OMIT( TT ) ) ) 
 456                         ? TRC_TRUE : TRC_FALSE;
 457  
 458         /* Process Event Message */ 
 459  
 460         nest = 0;
 461  
 462         done = 0;
 463  
 464         do 
 465         {
 466                 switch ( marker ) 
 467                 {
 468                         case TEV_MARK_EVENT_BUFFER: 
 469                         {
 470                                 nest++;
 471  
 472                                 break;
 473                         }
 474  
 475                         case TEV_MARK_EVENT_BUFFER_END: 
 476                         {
   ...
 527                                                 did_done++;
 528                                 }
 529                                 while ( !did_done );
 530  
 531                                 if ( !nest )
 532                                         done++;
 533  
 534                                 break;
 535                         }
 536  
 537                         case TEV_MARK_EVENT_DESC: 
 538                         {
allocated inside call539                                 TD = trc_create_tevdesc();     /* Leak */
     /kat0/fletcher/SATE/2010/pvm3/tracer/trcutil.c
     Enter trc_handle_trace_message / trc_create_tevdesc
 886   trc_create_tevdesc() 
 887   {
 888           TRC_TEVDESC tmp;
 889    
referenced by returned value890           tmp = (TRC_TEVDESC) malloc( sizeof( struct trc_tevdesc_struct ) );
referenced by tmp891           trc_memcheck( tmp, "Trace Event Descriptor Structure" );
 892    
 893           tmp->name = (char *) NULL;
 894    
 895           tmp->eid = -1;
 896    
 897           tmp->entry_exit = -1;
 898    
 899           tmp->index = -1;
 900    
 901           tmp->hid = -1;
 902    
 903           tmp->dump = -1;
 904    
 905           tmp->ddesc = (TRC_DATADESC) NULL;
 906    
 907           tmp->refcount = -1;
 908    
 909           tmp->next = (TRC_TEVDESC) NULL;
 910    
 911           return( tmp );
referenced by returned value912   } 
     Exit trc_handle_trace_message / trc_create_tevdesc
 540  
referenced by TD541                                 TD->refcount = 1;
 542  
 543                                 TRC_PVMCKERR( pvm_upkint( &eid, 1, 1 ),
 544                                         "Event Descriptor ID", return( ecnt ) );
 545  
 546                                 TD->eid = eid & ~( TEV_EVENT_ENTRY | TEV_EVENT_EXIT );
 547  
 548                                 if ( eid & TEV_EVENT_ENTRY )
 549                                         TD->entry_exit = TRC_ENTRY_TEV;
 550  
 551                                 else if ( eid & TEV_EVENT_EXIT )
 552                                         TD->entry_exit = TRC_EXIT_TEV;
 553  
 554                                 else 
   ...
 777  
 778                 if ( !done )
 779                 {
 780                         TRC_PVMCKERR( pvm_upkint( &marker, 1, 1 ),
 781                                 "Unpacking Trace Message", return( ecnt ) );
 782                 }
 783         }
 784         while ( !done );
 785  
 786         return( ecnt );
 787 } 
Preconditions
ID->tevtask_list >= 0
ID->trace_out = 0
pvmmytid = -1
pvmrbuf != 0
Postconditions
*stderr' is allocated by fopen
bytes_before(stderr)' = 0
TRC_TMP_CC' <= -1




Change Warning 438.29189 : Leak

Because they are very similar, this warning shares annotations with warning 438.29188.
CodeSonar has selected warning 438.29188 to represent this group of similar warnings. In order to edit this group, you must edit warning 438.29188.