Skip to content

Commit

Permalink
fix some memory leaks in mpf_mat
Browse files Browse the repository at this point in the history
  • Loading branch information
fandango96 committed Jun 23, 2014
1 parent 2589858 commit 84ac930
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
11 changes: 5 additions & 6 deletions fmpq_vec/dot.c
Expand Up @@ -33,10 +33,9 @@ _fmpq_vec_dot(fmpq_t res, const fmpq * vec1, const fmpq * vec2, slong len)
{
slong i;
fmpq_zero(res);

for(i = 0; i < len; i++) {
fmpq_addmul(res,
vec1 + i,
vec2 + i);
}

for (i = 0; i < len; i++)
{
fmpq_addmul(res, vec1 + i, vec2 + i);
}
}
1 change: 1 addition & 0 deletions mpf_mat/gso.c
Expand Up @@ -110,4 +110,5 @@ mpf_mat_gso(mpf_mat_t B, const mpf_mat_t A)
mpf_mul(mpf_mat_entry(B, j, k), mpf_mat_entry(B, j, k), s);
}
}
mpf_clears(t, s, tmp, eps, '\0');
}
1 change: 1 addition & 0 deletions mpf_mat/qr.c
Expand Up @@ -120,4 +120,5 @@ mpf_mat_qr(mpf_mat_t Q, mpf_mat_t R, const mpf_mat_t A)
mpf_mul(mpf_mat_entry(Q, j, k), mpf_mat_entry(Q, j, k), s);
}
}
mpf_clears(t, s, tmp, eps, '\0');
}
1 change: 1 addition & 0 deletions mpf_mat/test/t-qr.c
Expand Up @@ -125,6 +125,7 @@ main(void)
mpf_mat_clear(Q);
mpf_mat_clear(R);
mpf_mat_clear(B);
mpf_clears(dot, tmp, '\0');
}

FLINT_TEST_CLEANUP(state);
Expand Down

0 comments on commit 84ac930

Please sign in to comment.