Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Leak  at trcfile.c:3140

Categories: ALLOC.LEAK CWE:401 CWE:771 CWE:773
Warning ID: 465.29226
Procedure: trc_process_trace_event
Trace: view
Modified: Thu Nov 26 11:36:20 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/trcfile.c
   Enter trc_process_trace_event
 3073 trc_process_trace_event( ID, name, entry_exit, index ) 
 3074 TRC_ID ID;
 3075 char *name;
 3076 int entry_exit;
 3077 int index;
 3078 {
 3079         TRC_DATADESC DD;
 3080  
 3081         TRC_TEVDESC TD;
 3082  
 3083         TRC_TEVREC TR;
   ...
 3094         short   read_short;
 3095         long    read_long;
 3096         int             read_int;
 3097  
 3098         char c;
 3099  
 3100         int i, j;
 3101         int flag;
 3102         int num;
 3103  
 3104         if ( !(ID->handle_event) )
 3105         {
 3106                 trc_find_event_end( ID );
 3107  
 3108                 return( TRC_TRUE );
 3109         }
 3110  
 3111         TD = (TRC_TEVDESC) trc_lookup_trie( TRC_EVENT_TRIE, name );
 3112  
 3113         while ( TD != NULL &&
 3114                 ( TD->entry_exit != entry_exit || TD->index != index ) )
 3115         {
 3116                 TD = TD->next;
 3117         }
 3118  
 3119         if ( TD == NULL )
 3120         {
 3121                 printf( "Error: Event \"%s\" Descriptor Not Found\n", name );
 3122  
 3123                 trc_find_event_end( ID );
 3124  
 3125                 return( TRC_FALSE );
 3126         }
 3127  
 3128         if ( !trc_find_event_str( ID, "{" ) )
 3129                 return( TRC_FALSE );
 3130          
 3131         /* matching } */ 
 3132  
 3133         DD = TD->ddesc;
 3134  
 3135         TR = (TRC_TEVREC) NULL;
 3136  
 3137         while ( DD != NULL )
 3138         {
 3139                 if ( TR == NULL )
allocated inside call3140                         trptr = TR = trc_create_tevrec();     /* Leak */
     /kat0/fletcher/SATE/2010/pvm3/tracer/trcutil.c
     Enter trc_process_trace_event / trc_create_tevrec
 1132   trc_create_tevrec() 
 1133   {
 1134           TRC_TEVREC tmp;
 1135    
referenced by returned value1136           tmp = (TRC_TEVREC) malloc( sizeof( struct trc_tevrec_struct ) );
referenced by tmp1137           trc_memcheck( tmp, "Trace Event Record Structure" );
 1138    
 1139           tmp->ddesc = (TRC_DATADESC) NULL;
 1140    
 1141           tmp->value = (TRC_VALUE) NULL;
 1142    
 1143           tmp->num = -1;
 1144    
 1145           tmp->next = (TRC_TEVREC) NULL;
 1146    
 1147           return( tmp );
referenced by returned value1148   } 
     Exit trc_process_trace_event / trc_create_tevrec
 3141                  
 3142                 else 
 3143                         trptr = trptr->next = trc_create_tevrec();
 3144  
referenced by trptr and 1 others3145                 trptr->ddesc = DD;
 3146  
 3147                 if ( DD->array == TEV_DATA_ARRAY )
 3148                 {
 3149                         if ( !trc_find_event_str( ID, "[" ) )
 3150                                 return( TRC_FALSE );
 3151  
 3152                         flag = fscanf( ID->trace_in, "%d", &num );
 3153  
 3154                         if ( flag != 1 )
 3155                         {
 3156                                 printf( "Error Parsing Event Record\n" );
 3157  
 3158                                 trc_find_event_end( ID );
 3159  
 3160                                 return( TRC_FALSE );
   ...
 3534                 }
 3535  
 3536                 DD = DD->next;
 3537         }
 3538  
 3539         (ID->handle_event)( ID, TD, TR );
 3540  
 3541         trc_free_tevrec( &TR );
 3542  
 3543         return( TRC_TRUE );
 3544 } 
Preconditions
ID->handle_event != 0




Change Warning 465.29226 : Leak

Priority:
State:
Finding:
Owner:
Note: