genius r652 - in trunk: . src



Author: jirka
Date: Tue May 20 00:56:30 2008
New Revision: 652
URL: http://svn.gnome.org/viewvc/genius?rev=652&view=rev

Log:

Mon May 19 19:56:37 2008  Jiri (George) Lebl <jirka 5z com>

	* src/mpzextra.c: fix leak on mympz_is_prime.



Modified:
   trunk/ChangeLog
   trunk/src/mpzextra.c

Modified: trunk/src/mpzextra.c
==============================================================================
--- trunk/src/mpzextra.c	(original)
+++ trunk/src/mpzextra.c	Tue May 20 00:56:30 2008
@@ -222,11 +222,13 @@
 	if ( ! mympz_strong_pseudoprime_test_2_3_5_7 (n))
 		return 0;
 
-	if ( ! inited_test) {
+	if G_UNLIKELY ( ! inited_test) {
 		/* set test to 25*10^9 */
 		mpz_init_set_ui (test, 10);
 		mpz_pow_ui (test, test, 9);
 		mpz_mul_ui (test, test, 25);
+
+		inited_test = TRUE;
 	}
 
 	/* if n < 25*10^9, we are now sure this



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]