From 4e573bf068bfe7859af293a4210c5b5c65fa86ba Mon Sep 17 00:00:00 2001 From: mame Date: Mon, 25 Aug 2008 15:03:14 +0000 Subject: [PATCH] * ext/bigdecimal/bigdecimal.c (VpMult): fix double free. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ ext/bigdecimal/bigdecimal.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 60402f9c47..e4a44a61ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Aug 26 00:02:49 2008 Yusuke Endoh + + * ext/bigdecimal/bigdecimal.c (VpMult): fix double free. + Mon Aug 25 23:59:36 2008 Tanaka Akira * transcode.c (rb_econv_open): make last_tc NULL if there are only diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 213d9ea149..e8da7cc415 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -3165,7 +3165,7 @@ VpMult(Real *c, Real *a, Real *b) c->exponent = a->exponent; /* set exponent */ if(!AddExponent(c,b->exponent)) { - VpFree(c); + if(w) VpFree(c); return 0; } VpSetSign(c,VpGetSign(a)*VpGetSign(b)); /* set sign */