X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/d34decd2b2b88240cf4ca68a2a5feb7bf36de6e7..9eff9dadf9c9e5f71206a31327674f70fdccf4b0:/mp-mem.c diff --git a/mp-mem.c b/mp-mem.c index 7f9d630..f35fd58 100644 --- a/mp-mem.c +++ b/mp-mem.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: mp-mem.c,v 1.3 2000/06/17 11:45:09 mdw Exp $ + * $Id: mp-mem.c,v 1.4 2001/02/03 12:00:29 mdw Exp $ * * Memory management for multiprecision numbers * @@ -30,6 +30,10 @@ /*----- Revision history --------------------------------------------------* * * $Log: mp-mem.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 11:45:09 mdw * Major memory management overhaul. Added arena support. Use the secure * arena for secret integers. Replace and improve the MP management macros @@ -191,7 +195,7 @@ mp *mp_copy(mp *m) { return MP_COPY(m); } * If there are no more references, the integer is destroyed. */ -void mp_drop(mp *m) { MP_DROP(m); } +void mp_drop(mp *m) { if (m) MP_DROP(m); } /* --- @mp_split@ --- * *