summaryrefslogtreecommitdiff
path: root/rand
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2015-11-09 22:30:52 +0100
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2015-11-09 22:30:52 +0100
commit7acd63c08b3b969696681ee8125ea63e543998c8 (patch)
treefccdc23ceb50b4647ac4dd5848c9170972c3030d /rand
parente97517c73c6a962a9d2cd519adcc639087cd1a75 (diff)
downloadgmp-7acd63c08b3b969696681ee8125ea63e543998c8.tar.gz
mpz: Lazy allocation.
Diffstat (limited to 'rand')
-rw-r--r--rand/randlc2x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rand/randlc2x.c b/rand/randlc2x.c
index 195f75932..dc5a9a526 100644
--- a/rand/randlc2x.c
+++ b/rand/randlc2x.c
@@ -319,7 +319,7 @@ gmp_randinit_lc_2exp (gmp_randstate_t rstate,
if (SIZ (p->_mp_a) == 0)
{
SIZ (p->_mp_a) = 1;
- PTR (p->_mp_a)[0] = CNST_LIMB (0);
+ MPZ_NEWALLOC (p->_mp_a, 1)[0] = CNST_LIMB (0);
}
MPN_SET_UI (p->_cp, p->_cn, c);