summaryrefslogtreecommitdiffstats
path: root/ext/bigdecimal/bigdecimal.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bigdecimal/bigdecimal.c')
-rw-r--r--ext/bigdecimal/bigdecimal.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 51bd6447f..2498ea445 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -3164,7 +3164,10 @@ VpMult(Real *c, Real *a, Real *b)
/* set LHSV c info */
c->exponent = a->exponent; /* set exponent */
- if(!AddExponent(c,b->exponent)) return 0;
+ if(!AddExponent(c,b->exponent)) {
+ VpFree(c);
+ return 0;
+ }
VpSetSign(c,VpGetSign(a)*VpGetSign(b)); /* set sign */
Carry = 0;
nc = ind_c = MxIndAB;