[Gmp-commit] /var/hg/gmp: mini-gmp: Fix memory leak in t-gcd.

mercurial at gmplib.org mercurial at gmplib.org
Thu Jun 19 09:28:03 CEST 2025


details:   /var/hg/gmp/rev/f1c983debf6c
changeset: 18486:f1c983debf6c
user:      Niels Möller <nisse at lysator.liu.se>
date:      Thu Jun 19 09:27:33 2025 +0200
description:
mini-gmp: Fix memory leak in t-gcd.

diffstat:

 mini-gmp/ChangeLog     |  8 ++++++++
 mini-gmp/tests/t-gcd.c |  1 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diffs (26 lines):

diff -r 3ba8c772699e -r f1c983debf6c mini-gmp/ChangeLog
--- a/mini-gmp/ChangeLog	Wed Jun 18 17:17:26 2025 +0200
+++ b/mini-gmp/ChangeLog	Thu Jun 19 09:27:33 2025 +0200
@@ -1,3 +1,11 @@
+2025-06-19  Niels Möller  <nisse at lysator.liu.se>
+
+	* tests/t-gcd.c (test_one): Fix memory leak.
+
+2020-06-18  Torbjörn Granlund  <tg at gmplib.org>
+
+	* tests/t-gcd.c (test_one): Add cast for malloc result.
+
 2024-10-18  Niels Möller  <nisse at lysator.liu.se>
 
 	* mini-gmp.c (mpn_gcd): New function.
diff -r 3ba8c772699e -r f1c983debf6c mini-gmp/tests/t-gcd.c
--- a/mini-gmp/tests/t-gcd.c	Wed Jun 18 17:17:26 2025 +0200
+++ b/mini-gmp/tests/t-gcd.c	Thu Jun 19 09:27:33 2025 +0200
@@ -172,6 +172,7 @@
 	  dump ("ref", s);
 	  abort ();
 	}
+      free (tp);
     }
 
   mpz_clear (g);


More information about the gmp-commit mailing list