diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-31 13:18:10 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-31 13:18:10 +0000 |
commit | 9de7bcff88b3337a76bd21c6552f39cd4c12115f (patch) | |
tree | 23b3a9aeab320cfebb506b04d2f878a11407b907 /ext | |
parent | a4077a65dee8c046821942a2ec9d6d639d7c23fc (diff) | |
download | ruby-9de7bcff88b3337a76bd21c6552f39cd4c12115f.tar.gz |
* ext/bigdecimal/bigdecimal.c (VpMult): prevent memory leak.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 51bd6447ff..2498ea4450 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; |