Closed mmcco closed 7 years ago
I ran Clang's static analyzer on legofit and found a few minor issues. I'll open an issue for each.
This calloc(3) call appears on line 127 of boot.c:
calloc(3)
boot.c
self->count[i] = calloc((unsigned long) self->npat, sizeof(self->count[0]));
self->count is of type double **, so self->count[i] is of type double *. Therefore, if I understand correctly, the second argument of the calloc(3) call should be sizeof(double) or something equivalent. Currently, it is sizeof(double *).
self->count
double **
self->count[i]
double *
sizeof(double)
sizeof(double *)
I fixed this. The statement now reads:
self->count[i] = calloc((unsigned long) self->npat, sizeof(self->count[i][0]));
I ran Clang's static analyzer on legofit and found a few minor issues. I'll open an issue for each.
This
calloc(3)
call appears on line 127 ofboot.c
:self->count
is of typedouble **
, soself->count[i]
is of typedouble *
. Therefore, if I understand correctly, the second argument of thecalloc(3)
call should besizeof(double)
or something equivalent. Currently, it issizeof(double *)
.