Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Leak  at trcfile.c:2803

Categories: LANG.ALLOC.LEAK CWE:401 CWE:771 CWE:773
Warning ID: 2880.2946
Procedure: trc_read_descriptor
Trace: View
Modified: Wed Sep 2 12:51:56 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
   /u1/paul/SATE/2010/c/pvm/pvm3/tracer/trcfile.c
   Enter trc_read_descriptor
 2766 trc_read_descriptor( ID, eid, name, entry_exit, index ) 
 2767 TRC_ID ID;
 2768 int eid;
 2769 char *name;
 2770 int entry_exit;
 2771 int index;
 2772 {
 2773         TRC_DATADESC DD;
 2774  
 2775         TRC_TEVDESC TD;
 2776         TRC_TEVDESC tdptr;
   ...
 2782         char last;
 2783         char c;
 2784  
 2785         long tmp;
 2786  
 2787         int done;
 2788         int i;
 2789  
 2790         /* Find first bracket */ 
 2791  
 2792         if ( !trc_find_event_str( ID, "{" ) )
 2793                 return( (TRC_TEVDESC) NULL );
 2794  
 2795         /* matching } */ 
 2796  
 2797         /* Create Descriptor Structure */ 
 2798  
 2799         TD = trc_create_tevdesc();   /* Leak (ID: 2879.2945) */
 2800  
 2801         TD->refcount = 1;
 2802  
allocated inside call2803         TD->name = trc_copy_str( name );     /* Leak */
     /u1/paul/SATE/2010/c/pvm/pvm3/tracer/trcutil.c
     Enter trc_read_descriptor / trc_copy_str
 3031   char * 
 3032   trc_copy_str( str ) 
 3033   char *str;
 3034   {
 3035           char *tmp;
 3036    
referenced by returned value3037           tmp = (char *) malloc( (unsigned) (strlen(str) + 1)   /* Uninitialized Variable (ID: 2853.2916) */  /* Uninitialized Variable (ID: 2862.2927) */
 3038                   * sizeof(char) );
referenced by tmp3039           trc_memcheck(tmp,"Copy String");
 3040    
 3041           strcpy( tmp, str );
 3042    
 3043           return( tmp );
referenced by returned value3044   } 
     Exit trc_read_descriptor / trc_copy_str
 2804  
referenced by TD->name2805         TD->eid = eid;
 2806  
 2807         TD->entry_exit = entry_exit;
 2808  
 2809         TD->index = index;
 2810  
 2811         /* Read in Data Descriptor Statements */ 
 2812  
 2813         done = 0;
 2814  
 2815         do 
 2816         {
 2817                 /* matching { */ 
 2818  
 2819                 while ( (c = getc( ID->trace_in )) != (char) EOF 
 2820                         && c != '/' && c != '}' );
 2821  
 2822                 TRC_CKEOF( c, "EOF Reading Event Descriptor\n",
 2823                         return( (TRC_TEVDESC) NULL ) );
 2824  
 2825                 /* Another Descriptor Statement */ 
 2826  
 2827                 if ( c == '/' )
 2828                 {
 2829                         if ( TD->ddesc == NULL )
 2830                                 DD = TD->ddesc = trc_create_datadesc();   /* Leak (ID: 2878.2944) */
 2831  
 2832                         else 
 2833                                 DD = DD->next = trc_create_datadesc();
   ...
 3059                         tdptr->next = TD;
 3060         }
 3061  
 3062         /* Set Handle ID */ 
 3063  
 3064         tmp = (long) trc_lookup_trie( TRC_HANDLE_TRIE, TD->name );
 3065  
 3066         TD->hid = (int) tmp;
 3067  
 3068         return( TD );
 3069 } 




Change Warning 2880.2946 : Leak

Priority:
State:
Finding:
Owner:
Note: