ruby-changes:6780
From: mame <ko1@a...>
Date: Thu, 31 Jul 2008 22:18:25 +0900 (JST)
Subject: [ruby-changes:6780] Ruby:r18296 (trunk): * ext/bigdecimal/bigdecimal.c (VpMult): prevent memory leak.
mame 2008-07-31 22:18:10 +0900 (Thu, 31 Jul 2008) New Revision: 18296 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18296 Log: * ext/bigdecimal/bigdecimal.c (VpMult): prevent memory leak. Modified files: trunk/ChangeLog trunk/ext/bigdecimal/bigdecimal.c Index: ChangeLog =================================================================== --- ChangeLog (revision 18295) +++ ChangeLog (revision 18296) @@ -1,3 +1,7 @@ +Thu Jul 31 22:17:35 2008 Yusuke Endoh <mame@t...> + + * ext/bigdecimal/bigdecimal.c (VpMult): prevent memory leak. + Thu Jul 31 20:05:56 2008 NARUSE, Yui <naruse@r...> * test/ruby/test_transcode.rb (test_unicode_public_review_issue_121): Index: ext/bigdecimal/bigdecimal.c =================================================================== --- ext/bigdecimal/bigdecimal.c (revision 18295) +++ ext/bigdecimal/bigdecimal.c (revision 18296) @@ -3164,7 +3164,10 @@ /* 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/