examples++-load/mshmet.cpp:221: error: NULL_DEREFERENCE pointer `sol` last assigned on line 220 could be null and is dereferenced at line 221, column 3. Showing all 15 steps of the trace examples++-load/mshmet.cpp:215:1: start of procedure sol_mshmet() 213. 214. 215. > MSHMET_pSol sol_mshmet(const int &dim, const int & np, const int &type, const int &size, int *typtab, const KN &solutions){ 216. static const int wrapperMetric[6]={0,1,3,2,4,5}; 217. MSHMET_pSol sol; examples++-load/mshmet.cpp:216:3: 214. 215. MSHMET_pSol sol_mshmet(const int &dim, const int & np, const int &type, const int &size, int *typtab, const KN &solutions){ 216. > static const int wrapperMetric[6]={0,1,3,2,4,5}; 217. MSHMET_pSol sol; 218. int k,ia,i; examples++-load/mshmet.cpp:220:3: 218. int k,ia,i; 219. 220. > sol= (MSHMET_pSol)M_calloc(1,sizeof(MSHMET_Sol),"sol") ; 221. sol->ver = 0; 222. sol->np = np; src/libMesh/memory.c:123:1: start of procedure M_calloc() 121. elsize bytes, and initializes the space to zeros. 122. Actual amount of space allocated is >= nelem * elsize bytes. */ 123. > void *M_calloc(size_t nelem, size_t elsize,char *call) { 124. int i; 125. src/libMesh/memory.c:127:9: Taking true branch 125. 126. /* check if first call */ 127. if ( !mstack ) { ^ 128. mstack = (Memstack *)calloc((1+MAXMEM),sizeof(Memstack)); 129. assert(mstack); src/libMesh/memory.c:128:5: 126. /* check if first call */ 127. if ( !mstack ) { 128. > mstack = (Memstack *)calloc((1+MAXMEM),sizeof(Memstack)); 129. assert(mstack); 130. for (i=1; i for (i=1; i cur = 1; 133. stack = 0; 134. } src/libMesh/memory.c:133:5: 131. mstack[i].nxt = i+1; 132. cur = 1; 133. > stack = 0; 134. } 135. src/libMesh/memory.c:137:8: Taking false branch 135. 136. /* store pointer, size */ 137. if ( stack < MAXMEM ) { ^ 138. mstack[cur].ptr = calloc(nelem,elsize); 139. if ( !mstack[cur].ptr ) return(0); src/libMesh/memory.c:156:5: 154. } 155. else { 156. > fprintf(stderr,"M_calloc: unable to allocate %10zd bytes. table full\n", 157. nelem*elsize); 158. return(0); src/libMesh/memory.c:158:5: 156. fprintf(stderr,"M_calloc: unable to allocate %10zd bytes. table full\n", 157. nelem*elsize); 158. > return(0); 159. } 160. } src/libMesh/memory.c:160:1: return from a call to M_calloc 158. return(0); 159. } 160. > } 161. 162. /* Changes the size of the block pointed to by ptr to size bytes examples++-load/mshmet.cpp:221:3: 219. 220. sol= (MSHMET_pSol)M_calloc(1,sizeof(MSHMET_Sol),"sol") ; 221. > sol->ver = 0; 222. sol->np = np; 223. sol->dim = dim;