Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Leak  at pvmgs_core.c:276

Categories: ALLOC.LEAK CWE:401 CWE:771 CWE:773
Warning ID: 559.29354
Procedure: gs_handle
Trace: view
Modified: Thu Nov 26 11:39:12 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/pvmgs/pvmgs_core.c
   Enter gs_handle
 245 gs_handle( hash_list, ngroups, gstid ) 
 246 GROUP_LIST_PTR hash_list;
 247 int *ngroups, *gstid;
 248 {
 249         int len, msgtag, tid, gid, cc, ftid, inst, i, size, ntids, listsize;
 250         int cnt, hosttid, nhosts, nmem_onhost, pcoord;
 251         int *nmem_onhostv = (int *) NULL, *pcoordv = (int *) NULL;  
 252         int mxupklen = 0;
 253         GROUP_STRUCT_PTR group;
 254         char *groupname = (char *) NULL;
 255         int *tidlist = (int *) NULL;
 256         int maxntids = 0, info;
 257         int gstate;
 258  
 259         while ( 1 )  
 260         {
 261                 if ( (cc = pvm_recv( -1, -1 )) < 0 )  /* receive a request */ 
 262                 {
 263                         pvm_perror( "gs_handle(recv)" );
 264                         return( cc );
 265                 }
 266                 /* get: length of message, message tag, and sending tid */ 
 267                 if ( (cc = pvm_bufinfo( pvm_getrbuf(), &len, &msgtag, &tid )) 
 268                                 < 0 )  
 269                 {
 270                         pvm_perror("gs_handle(bufinfo)");
 271                         return( cc );
 272                 }
 273  
 274                 /* Most group functions require unpacking a group name, so */ 
 275                 /* Make sure variable groupname is always long enough */ 
referenced by returned value276                 REALLOCSTRING( len, mxupklen , groupname, "gs_handle(entry)" );     /* Leak */  /* Ignored Return Value (ID: 571.29375) */
 277  
referenced by groupname278                 switch( msgtag ) 
 279                 {
 280                         case (DIE):             /* leave a suicide note */ 
 281                                 gs_pstate( "pvmgs", hash_list, ngroups );
 282                                 return( PvmOk );
 283  
 284                         case (JOIN):    /* join a group with the lowest avail gid */ 
 285                                 pvm_upkstr( groupname );
 286                                 gid = gs_join( groupname, tid, hash_list, ngroups );
 287                                 /* tell me if the tid dies */ 
 288                                 if ( pvm_notify( PvmTaskExit, DEADTID, 1, &tid ) < 0 )  
 289                                         pvm_perror( "pvmgs-join" );
 290                                 SENDINTRESULT( gid, tid, msgtag, "gs_handle(join)" );
 291                                 break;
 292  
   ...
 408                                 pvm_pkint( pcoordv, nhosts, 1 );  
 409                                 PK_STATE( tid, gstate, groupname, hash_list, ngroups,
 410                                                 "gs_handle(hostchar)" );
 411                                 SENDRESULT( tid, msgtag, "gs_handle(hostchar)" );
 412                                 break;
 413  
 414                         default: 
 415                                 break;
 416                 }  /* Switch - statement */ 
 417         } /* While - statement */ 
 418 } 
Preconditions
hash_list >= 2956
hash_list[95].next = 0
pvmautoerr != 2
pvmautoerr != 3
pvmtoplvl != 0
Postconditions
pvmmytid' <= -1
pvmtrccodef' = &$unknown_14669319




Change Warning 559.29354 : Leak

Priority:
State:
Finding:
Owner:
Note: