Now @mp_drop@ checks its argument is non-NULL before attempting to free
[u/mdw/catacomb] / bbs-rand.c
index dbca23c..abe1e72 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: bbs-rand.c,v 1.3 2000/06/17 10:45:21 mdw Exp $
+ * $Id: bbs-rand.c,v 1.4 2001/02/03 12:00:29 mdw Exp $
  *
  * Blum-Blum-Shub secure random number generator
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: bbs-rand.c,v $
+ * Revision 1.4  2001/02/03 12:00:29  mdw
+ * Now @mp_drop@ checks its argument is non-NULL before attempting to free
+ * it.  Note that the macro version @MP_DROP@ doesn't do this.
+ *
  * Revision 1.3  2000/06/17 10:45:21  mdw
  * Typesetting fixes.  Advertise random number generator strength.  Use
  * secure arena for memory allocation.
@@ -134,8 +138,7 @@ void bbs_step(bbs *b)
 
 void bbs_set(bbs *b, mp *x)
 {
-  if (b->x)
-    mp_drop(b->x);
+  mp_drop(b->x);
   b->x = MP_COPY(x);
   bbs_step(b);
 }