mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
merges r29803 from trunk into ruby_1_9_2.
-- * regparse.c (and_cclass, or_cclass): fix memory leak. Coverity Scan found this bug. [ruby-dev:42579] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b6e3b715dd
commit
79128855ab
3 changed files with 18 additions and 15 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Nov 16 00:21:20 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* regparse.c (and_cclass, or_cclass): fix memory leak. Coverity Scan
|
||||
found this bug. [ruby-dev:42579]
|
||||
|
||||
Mon Nov 15 23:54:45 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* eval_intern.h (CHECK_STACK_OVERFLOW): it was not intended to add
|
||||
|
|
26
regparse.c
26
regparse.c
|
@ -2006,7 +2006,7 @@ and_cclass(CClassNode* dest, CClassNode* cc, ScanEnv* env)
|
|||
{
|
||||
OnigEncoding enc = env->enc;
|
||||
int r, not1, not2;
|
||||
BBuf *buf1, *buf2, *pbuf;
|
||||
BBuf *buf1, *buf2, *pbuf = 0;
|
||||
BitSetRef bsr1, bsr2;
|
||||
BitSet bs1, bs2;
|
||||
|
||||
|
@ -2041,17 +2041,16 @@ and_cclass(CClassNode* dest, CClassNode* cc, ScanEnv* env)
|
|||
else {
|
||||
r = and_code_range_buf(buf1, not1, buf2, not2, &pbuf, env);
|
||||
if (r == 0 && not1 != 0) {
|
||||
BBuf *tbuf;
|
||||
BBuf *tbuf = 0;
|
||||
r = not_code_range_buf(enc, pbuf, &tbuf, env);
|
||||
if (r != 0) {
|
||||
bbuf_free(pbuf);
|
||||
return r;
|
||||
}
|
||||
bbuf_free(pbuf);
|
||||
pbuf = tbuf;
|
||||
}
|
||||
}
|
||||
if (r != 0) return r;
|
||||
if (r != 0) {
|
||||
bbuf_free(pbuf);
|
||||
return r;
|
||||
}
|
||||
|
||||
dest->mbuf = pbuf;
|
||||
bbuf_free(buf1);
|
||||
|
@ -2065,7 +2064,7 @@ or_cclass(CClassNode* dest, CClassNode* cc, ScanEnv* env)
|
|||
{
|
||||
OnigEncoding enc = env->enc;
|
||||
int r, not1, not2;
|
||||
BBuf *buf1, *buf2, *pbuf;
|
||||
BBuf *buf1, *buf2, *pbuf = 0;
|
||||
BitSetRef bsr1, bsr2;
|
||||
BitSet bs1, bs2;
|
||||
|
||||
|
@ -2100,17 +2099,16 @@ or_cclass(CClassNode* dest, CClassNode* cc, ScanEnv* env)
|
|||
else {
|
||||
r = or_code_range_buf(enc, buf1, not1, buf2, not2, &pbuf, env);
|
||||
if (r == 0 && not1 != 0) {
|
||||
BBuf *tbuf;
|
||||
BBuf *tbuf = 0;
|
||||
r = not_code_range_buf(enc, pbuf, &tbuf, env);
|
||||
if (r != 0) {
|
||||
bbuf_free(pbuf);
|
||||
return r;
|
||||
}
|
||||
bbuf_free(pbuf);
|
||||
pbuf = tbuf;
|
||||
}
|
||||
}
|
||||
if (r != 0) return r;
|
||||
if (r != 0) {
|
||||
bbuf_free(pbuf);
|
||||
return r;
|
||||
}
|
||||
|
||||
dest->mbuf = pbuf;
|
||||
bbuf_free(buf1);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#define RUBY_VERSION "1.9.2"
|
||||
#define RUBY_PATCHLEVEL 96
|
||||
#define RUBY_PATCHLEVEL 97
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
#define RUBY_VERSION_MINOR 9
|
||||
#define RUBY_VERSION_TEENY 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue