Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
Remove memory leaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
wbhart committed Sep 29, 2020
1 parent 0e257f0 commit cea21ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nf_elem/sqrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
* add is_square function
* test non-squares
* fix bug in fmpz_factor_trial #843
* valgrind
*/

#define ROT(u,v,t) \
Expand Down Expand Up @@ -514,6 +513,7 @@ int _nf_elem_sqrt(nf_elem_t a, const nf_elem_t b, const nf_t nf)
{
res = 0;
nf_elem_zero(a, nf);
_fmpz_vec_clear(r, fac->num);
_fmpz_vec_clear(modulus, fac->num);
goto cleanup;
}
Expand Down Expand Up @@ -687,6 +687,7 @@ int _nf_elem_sqrt(nf_elem_t a, const nf_elem_t b, const nf_t nf)
}

fmpz_clear(m);
_fmpz_vec_clear(r, fac->num);
_fmpz_vec_clear(mr, fac->num);
_fmpz_vec_clear(modulus, fac->num);
nf_elem_clear(sqr, nf);
Expand All @@ -703,7 +704,6 @@ int _nf_elem_sqrt(nf_elem_t a, const nf_elem_t b, const nf_t nf)
fmpz_clear(temp);
fmpz_clear(z);

_fmpz_vec_clear(r, fac->num);
_fmpz_vec_clear(bz, NF_ELEM(b)->length);
_fmpz_vec_clear(bz1, NF_ELEM(b)->length);

Expand Down

0 comments on commit cea21ec

Please sign in to comment.