зеркало из https://github.com/github/ruby.git
* string.c (rb_str_casemap): fix memory leak.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
9d291c82e5
Коммит
8272729977
|
@ -1,3 +1,7 @@
|
|||
Tue Jun 21 16:13:45 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_casemap): fix memory leak.
|
||||
|
||||
Tue Jun 21 16:12:21 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_casemap): int is too small for string size.
|
||||
|
|
4
string.c
4
string.c
|
@ -5809,8 +5809,10 @@ rb_str_casemap(VALUE source, OnigCaseFoldType *flags, rb_encoding *enc)
|
|||
}
|
||||
/* fprintf(stderr, "Buffer count is %d\n", buffer_count); *//* for tuning */
|
||||
|
||||
if (buffer_count==1)
|
||||
if (buffer_count==1) {
|
||||
target = rb_str_new_with_class(source, (const char*)current_buffer->space, target_length);
|
||||
xfree(current_buffer);
|
||||
}
|
||||
else {
|
||||
char *target_current = RSTRING_PTR(target = rb_str_new_with_class(source, 0, target_length));
|
||||
mapping_buffer *previous_buffer;
|
||||
|
|
Загрузка…
Ссылка в новой задаче