cipher: fix memory leaks

NIIBE Yutaka gniibe at fsij.org
Tue Aug 6 07:38:05 CEST 2013


On 2013-08-06 at 11:28 +0900, NIIBE Yutaka wrote:
> I found memory leaks, and following is my fix for master.

Another fix.

diff --git a/cipher/ecc.c b/cipher/ecc.c
index 375eeaf..b694d76 100644
--- a/cipher/ecc.c
+++ b/cipher/ecc.c
@@ -1319,6 +1319,7 @@ ecc_get_curve (gcry_mpi_t *pkey, int iterator, unsigned int *r_nbits)
                           tmp = scanval (domain_parms[idx].g_y);
                           if (!mpi_cmp (tmp, E.G.y))
                             {
+                              mpi_free (tmp);
                               result = domain_parms[idx].desc;
                               if (r_nbits)
                                 *r_nbits = domain_parms[idx].nbits;
-- 





More information about the Gcrypt-devel mailing list