diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-11-12 11:37:54 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-11-12 11:37:54 +0100 |
commit | 3d2819e491aee6a504a54e15f6eafa9707a1ce67 (patch) | |
tree | ab4c1dc4de92947cdd9fe29dc934af8af0608a83 /ext/bcmath/libbcmath/src | |
parent | d033d5c07a25ab36a9138f35a7a02f62822a9e4d (diff) | |
download | php-git-3d2819e491aee6a504a54e15f6eafa9707a1ce67.tar.gz |
Fix memory leak with bcsqrt on number 0<X<1
Diffstat (limited to 'ext/bcmath/libbcmath/src')
-rw-r--r-- | ext/bcmath/libbcmath/src/sqrt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/bcmath/libbcmath/src/sqrt.c b/ext/bcmath/libbcmath/src/sqrt.c index 6358ff7bcd..96cff29475 100644 --- a/ext/bcmath/libbcmath/src/sqrt.c +++ b/ext/bcmath/libbcmath/src/sqrt.c @@ -70,7 +70,6 @@ bc_sqrt (bc_num *num, int scale) /* Initialize the variables. */ rscale = MAX (scale, (*num)->n_scale); - bc_init_num(&guess); bc_init_num(&guess1); bc_init_num(&diff); point5 = bc_new_num (1,1); @@ -87,6 +86,7 @@ bc_sqrt (bc_num *num, int scale) else { /* The number is greater than 1. Guess should start at 10^(exp/2). */ + bc_init_num(&guess); bc_int2num (&guess,10); bc_int2num (&guess1,(*num)->n_len); |