Text  |   XML   |   Visible Warnings:

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

Categories: LANG.ALLOC.LEAK CWE:401 CWE:771 CWE:773
Warning ID: 2878.2944
Procedure: trc_read_descriptor
Trace: View
Modified: Wed Sep 2 12:51:55 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  
 2803         TD->name = trc_copy_str( name );   /* Leak (ID: 2880.2946) */
 2804  
 2805         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 )
allocated inside call2830                                 DD = TD->ddesc = trc_create_datadesc();     /* Leak */
     /u1/paul/SATE/2010/c/pvm/pvm3/tracer/trcutil.c
     Enter trc_read_descriptor / trc_create_datadesc
 783   trc_create_datadesc() 
 784   {
 785           TRC_DATADESC tmp;
 786    
referenced by returned value787           tmp = (TRC_DATADESC) malloc( sizeof( struct trc_datadesc_struct ) );
referenced by tmp788           trc_memcheck( tmp, "Data Description Structure" );
 789    
 790           tmp->did = (TRC_DID) NULL;
 791    
 792           tmp->dt = -1;
 793    
 794           tmp->array = -1;
 795    
 796           tmp->data = (TRC_VALUE) NULL;
 797    
 798           tmp->num = -1;
 799    
 800           tmp->next = (TRC_DATADESC) NULL;
 801    
 802           return( tmp );
referenced by returned value803   } 
     Exit trc_read_descriptor / trc_create_datadesc
 2831  
 2832                         else 
 2833                                 DD = DD->next = trc_create_datadesc();
 2834  
 2835                         /* Get Second '/' */ 
 2836  
referenced by DD and 1 others2837                         c = getc( ID->trace_in );
 2838  
 2839                         TRC_CKEOF( c, "EOF Reading Event Descriptor\n",
 2840                                 return( (TRC_TEVDESC) NULL ) );
 2841  
 2842                         if ( c != '/' )
 2843                         {
 2844                                 printf( "Error Parsing Event Descriptor\n" );
 2845  
 2846                                 return( (TRC_TEVDESC) NULL );
 2847                         }
 2848  
 2849                         /* Read in TRC_DID Name */ 
 2850  
   ...
 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 2878.2944 : Leak

Priority:
State:
Finding:
Owner:
Note: