[PATCH 2/6] ecc: fix memory leak

Peter Wu peter at lekensteyn.nl
Thu Jul 9 17:11:32 CEST 2015


* cipher/ecc.c: Release memory which was allocated before by
  _gcry_pk_util_preparse_sigval.
--
Caught by LeakSanitizer (LSan). Now the test suite (make check) passes
with no memleaks.

Signed-off-by: Peter Wu <peter at lekensteyn.nl>
---
 cipher/ecc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cipher/ecc.c b/cipher/ecc.c
index f5bc50a..c17a553 100644
--- a/cipher/ecc.c
+++ b/cipher/ecc.c
@@ -1040,6 +1040,7 @@ ecc_verify (gcry_sexp_t s_sig, gcry_sexp_t s_data, gcry_sexp_t s_keyparms)
       if (rc)
         goto leave;
     }
+  sexp_release (l1);
   /* Add missing parameters using the optional curve parameter.  */
   l1 = sexp_find_token (s_keyparms, "curve", 5);
   if (l1)
-- 
2.4.4




More information about the Gcrypt-devel mailing list