Fix memory leak in eccdata.
authorNiels Möller <nisse@lysator.liu.se>
Thu, 12 Jul 2018 20:32:59 +0000 (22:32 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Thu, 12 Jul 2018 20:32:59 +0000 (22:32 +0200)
ChangeLog
eccdata.c

index 0312c62e6a6b3399bf63140aca572cf32d3f8827..4141e57dbb6e005fb4e91bddf857cd3a7f4ed83a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-07-12  Niels Möller  <nisse@lysator.liu.se>
+
+       * eccdata.c (output_curve): Replace mpz_init_set_ui by mpz_set_ui,
+       to fix memory leak.
+
 2018-07-08  Niels Möller  <nisse@lysator.liu.se>
 
        * fat-x86_64.c (fat_init): Fix setup for nettle_sha1_compress.
index a4723f1ea399977ff82fa82c2818ddbbf37c14ef..92e244bd1346d02b55d453389d8551ec43491982 100644 (file)
--- a/eccdata.c
+++ b/eccdata.c
@@ -1143,7 +1143,7 @@ output_curve (const struct ecc_curve *ecc, unsigned bits_per_limb)
 
   printf ("#else\n");
 
-  mpz_init_set_ui (t, 1);
+  mpz_set_ui (t, 1);
   output_bignum ("ecc_unit", t, limb_size, bits_per_limb);
   
   printf ("static const mp_limb_t ecc_table[%lu] = {",