Code auditing weekend results and fixes committing.
[silc.git] / lib / silcmath / silcprimegen.c
index 14719be26dce7cfb8c6b0cee5726a90fe926217f..b86a6aadf7ccd3f21bd1eb85811abb3ab1d580e1 100644 (file)
   GNU General Public License for more details.
 
 */
-/*
- * Created: Mon Dec  8 16:35:37 GMT+0200 1997
- */
-/*
- * $Id$
- * $Log$
- * Revision 1.1  2000/06/27 11:36:51  priikone
- * Initial revision
- *
- *
- */
+/* Created: Mon Dec  8 16:35:37 GMT+0200 1997 */
+/* $Id$ */
 
 #include "silcincludes.h"
 
@@ -247,7 +238,7 @@ int silc_math_gen_prime(SilcInt *prime, unsigned int bits, int verbose)
 
   /* Init modulo table with the prime candidate and the primes
      in the primetable. */
-  spmods = silc_malloc(sizeof(primetable) * sizeof(unsigned int));
+  spmods = silc_calloc(1, sizeof(primetable) * sizeof(unsigned int));
   for (i = 0; primetable[i] != 0; i++) {
     silc_mp_mod_ui(&tmp, prime, primetable[i]);
     spmods[i] = silc_mp_get_ui(&tmp);