I am using some a piece of code that blows up the memory usage. The function is the following
and it is used inside another function (let's say "func") that it is called repeatdly in the main program. In particular inside this function the former is used as follows
static double ** matrix(int nrh, int nch)
m = (double **) calloc((nrh + 1), sizeof(double *));
for (i = 0; i <= nrh; i++)
m[i] = (double*) calloc((nch + 1), sizeof(double));
I guess that the problem is that P is not freed at the end of func. I have tried free(P), but of course it did not work. Somebody can help me?