diff --git a/check.h b/check.h index 99425cf..ad40903 100644 --- a/check.h +++ b/check.h @@ -29,7 +29,7 @@ #define CHK_MALLOC(p, t, n) do { \ size_t CHK_MALLOC_n_tmp = (n); \ - (p) = (t *) malloc(sizeof(t) * CHK_MALLOC_n_tmp); \ + (p) = (t *) calloc(CHK_MALLOC_n_tmp, sizeof(t)); \ CHECK((p) || CHK_MALLOC_n_tmp == 0, "out of memory!"); \ } while (0) diff --git a/harminv.c b/harminv.c index f115923..7c94038 100644 --- a/harminv.c +++ b/harminv.c @@ -460,7 +460,7 @@ static cmplx symmetric_dot(int n, cmplx *x, cmplx *y) conjugation). */ static void solve_eigenvects(int n, const cmplx *A0, cmplx *V, cmplx *v) { - int lwork, info; + int lwork, info = 0; cmplx *work; double *rwork; cmplx *A;