diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2022-02-01 08:55:10 +0100 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2022-02-01 08:55:10 +0100 |
commit | ff819072509267e2e9ac28d0781c7696c40b9208 (patch) | |
tree | 3ed331df9750b3fa034b0ee1bee66d9df8dbd682 /mpz | |
parent | a7868ec78696b05df5971a3866bd204f6580d4ed (diff) | |
download | gmp-ff819072509267e2e9ac28d0781c7696c40b9208.tar.gz |
mpz/aorsmul_i.c: Use MPZ_NEWALLOC when the operand is overwritten
Diffstat (limited to 'mpz')
-rw-r--r-- | mpz/aorsmul_i.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mpz/aorsmul_i.c b/mpz/aorsmul_i.c index 8ddcc8830..317be3ef6 100644 --- a/mpz/aorsmul_i.c +++ b/mpz/aorsmul_i.c @@ -4,7 +4,8 @@ ALMOST CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN FUTURE GNU MP RELEASES. -Copyright 2001, 2002, 2004, 2005, 2012, 2021 Free Software Foundation, Inc. +Copyright 2001, 2002, 2004, 2005, 2012, 2021, 2022 Free Software +Foundation, Inc. This file is part of the GNU MP Library. @@ -85,7 +86,7 @@ mpz_aorsmul_1 (mpz_ptr w, mpz_srcptr x, mp_limb_t y, mp_size_t sub) if (wsize_signed == 0) { /* nothing to add to, just set x*y, "sub" gives the sign */ - wp = MPZ_REALLOC (w, xsize+1); + wp = MPZ_NEWALLOC (w, xsize+1); cy = mpn_mul_1 (wp, PTR(x), xsize, y); wp[xsize] = cy; xsize += (cy != 0); |