Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Unused Value  at pvmgs_func.c:70

Categories: LANG.STRUCT.UVAL CWE:563
Warning ID: 550.29344
Procedure: gs_realloc_int_array
Trace: view
Modified: Thu Nov 26 11:38:33 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     
LineSource
  /kat0/fletcher/SATE/2010/pvm3/pvmgs/pvmgs_func.c
  Enter gs_realloc_int_array
53 int * 
54 gs_realloc_int_array(nelems, maxelems, array, inc, init, caller) 
55 int nelems;
56 int *maxelems;
57 int *array;
58 int inc;
59 int init;
60 char *caller;
61 {
62         int i;
63         int *newarray, *newvalue;
64         int oldmax;  
65         int *value;  
66  
67         if (nelems <= *maxelems)  
68                 return(array);
69  
70         newarray = array;     /* Unused Value */
71          
72         oldmax = *maxelems;
73  
74         *maxelems += inc;
75  
76         if ( (newarray = (int *) PVM_ALLOC(sizeof(int) * (*maxelems), caller))   /* Integer Overflow of Allocation Size (ID: 551.29345) */
77                                 == (int *) NULL)        
78         {
79                 fprintf(stderr, "could not allocate memory: %s\n", caller);
80                 return(newarray);
81         }
82  
83         /* copy the old array contents to the new array, initialize the    */ 
84         /* new memory with the specified init value                        */ 
85         if (oldmax > 0)
86                 BCOPY(array, newarray, oldmax*sizeof(int));
87  
88         newvalue = newarray+oldmax;
89  
90         for (i = oldmax;  i < *maxelems; i++)
91                 *newvalue++ = init;
92  
93         if (array != (int *) NULL)  /* initial array could be NULL */ 
94                 PVM_FREE(array);
95  
96         return(newarray);
97 } 




Change Warning 550.29344 : Unused Value

Priority:
State:
Finding:
Owner:
Note: