diff options
author | Werner Koch <wk@gnupg.org> | 1998-10-12 22:16:38 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1998-10-12 22:16:38 +0200 |
commit | 8477407e794951c686e3afe1d13035abd0153d9f (patch) | |
tree | a062f99923861fe7c55d5cc2ff3cf04daba8c8e0 /mpi | |
parent | a new release (diff) | |
download | gnupg2-8477407e794951c686e3afe1d13035abd0153d9f.tar.xz gnupg2-8477407e794951c686e3afe1d13035abd0153d9f.zip |
backup
Diffstat (limited to 'mpi')
-rw-r--r-- | mpi/ChangeLog | 4 | ||||
-rw-r--r-- | mpi/mpi-div.c | 8 | ||||
-rw-r--r-- | mpi/mpi-inv.c | 3 | ||||
-rw-r--r-- | mpi/mpi-mpow.c | 2 | ||||
-rw-r--r-- | mpi/mpiutil.c | 1 |
5 files changed, 12 insertions, 6 deletions
diff --git a/mpi/ChangeLog b/mpi/ChangeLog index 696fba4dc..b2e8296ad 100644 --- a/mpi/ChangeLog +++ b/mpi/ChangeLog @@ -1,3 +1,7 @@ +Thu Oct 8 13:28:17 1998 Werner Koch (wk@isil.d.shuttle.de) + + * mpi-mpow.c (mpi_mulpowm): Fixed mem leak (m_free/mpi_free). + Thu Sep 17 18:08:50 1998 Werner Koch (wk@(none)) * hppa1.1/udiv-qrnnd.S: Fix from Steffen Zahn for HPUX 10.20 diff --git a/mpi/mpi-div.c b/mpi/mpi-div.c index 62ac87158..b5f5809f1 100644 --- a/mpi/mpi-div.c +++ b/mpi/mpi-div.c @@ -146,8 +146,7 @@ mpi_tdiv_qr( MPI quot, MPI rem, MPI num, MPI den) * We need space for an extra limb in the remainder, because it's * up-shifted (normalized) below. */ rsize = nsize + 1; - if( rem->alloced < rsize ) - mpi_resize( rem, rsize); + mpi_resize( rem, rsize); qsize = rsize - dsize; /* qsize cannot be bigger than this. */ if( qsize <= 0 ) { @@ -165,7 +164,7 @@ mpi_tdiv_qr( MPI quot, MPI rem, MPI num, MPI den) return; } - if( quot && quot->alloced < qsize ) + if( quot ) mpi_resize( quot, qsize); /* Read pointers here, when reallocation is finished. */ @@ -198,7 +197,8 @@ mpi_tdiv_qr( MPI quot, MPI rem, MPI num, MPI den) /* Make sure QP and NP point to different objects. Otherwise the * numerator would be gradually overwritten by the quotient limbs. */ if(qp == np) { /* Copy NP object to temporary space. */ - np = marker[markidx++] = mpi_alloc_limb_space(nsize,mpi_is_secure(quot)); + np = marker[markidx++] = mpi_alloc_limb_space(nsize, + mpi_is_secure(quot)); MPN_COPY(np, qp, nsize); } } diff --git a/mpi/mpi-inv.c b/mpi/mpi-inv.c index 150d87ca1..fca609600 100644 --- a/mpi/mpi-inv.c +++ b/mpi/mpi-inv.c @@ -260,6 +260,9 @@ mpi_invm( MPI x, MPI a, MPI n ) mpi_free(u3); mpi_free(v3); mpi_free(t3); + + mpi_free(u); + mpi_free(v); #endif } diff --git a/mpi/mpi-mpow.c b/mpi/mpi-mpow.c index e0ed53109..0a7ef50e9 100644 --- a/mpi/mpi-mpow.c +++ b/mpi/mpi-mpow.c @@ -111,7 +111,7 @@ mpi_mulpowm( MPI res, MPI *basearray, MPI *exparray, MPI m) } /* cleanup */ - m_free(tmp); + mpi_free(tmp); for(i=0; i < (1<<k); i++ ) mpi_free(G[i]); m_free(G); diff --git a/mpi/mpiutil.c b/mpi/mpiutil.c index 5dd65aebe..a94cbb499 100644 --- a/mpi/mpiutil.c +++ b/mpi/mpiutil.c @@ -372,4 +372,3 @@ mpi_swap( MPI a, MPI b) tmp = *a; *a = *b; *b = tmp; } - |