1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* string.c (rb_str_clear): need to check STR_EMBED_P() before

free()ing memory.  a patch from Yusuke ENDOH <mame AT tsg.ne.jp>.
  [ruby-dev:31062]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-06-26 15:19:39 +00:00
parent 883fadf9af
commit 99c58e9ebc
3 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,9 @@
Wed Jun 27 00:18:41 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_clear): need to check STR_EMBED_P() before
free()ing memory. a patch from Yusuke ENDOH <mame AT tsg.ne.jp>.
[ruby-dev:31062]
Tue Jun 26 16:39:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> Tue Jun 26 16:39:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* process.c (proc_getgroups): use GIDT2NUM for rb_gid_t. * process.c (proc_getgroups): use GIDT2NUM for rb_gid_t.

View file

@ -2347,7 +2347,7 @@ static VALUE
rb_str_clear(VALUE str) rb_str_clear(VALUE str)
{ {
/* rb_str_modify() */ /* no need for str_make_independent */ /* rb_str_modify() */ /* no need for str_make_independent */
if (str_independent(str)) { if (str_independent(str) && !STR_EMBED_P(str)) {
free(RSTRING_PTR(str)); free(RSTRING_PTR(str));
} }
STR_SET_EMBED(str); STR_SET_EMBED(str);

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0" #define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2007-06-26" #define RUBY_RELEASE_DATE "2007-06-27"
#define RUBY_VERSION_CODE 190 #define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20070626 #define RUBY_RELEASE_CODE 20070627
#define RUBY_PATCHLEVEL 0 #define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0 #define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 6 #define RUBY_RELEASE_MONTH 6
#define RUBY_RELEASE_DAY 26 #define RUBY_RELEASE_DAY 27
#ifdef RUBY_EXTERN #ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[]; RUBY_EXTERN const char ruby_version[];