diff options
| author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-20 17:54:46 +0000 |
|---|---|---|
| committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-20 17:54:46 +0000 |
| commit | cc2724c116a42bd9282b52d2386207013d2ed245 (patch) | |
| tree | aa6aef3384b506d3ff5de53208c4b2a8840574df /ext | |
| parent | a1299e85d648c96d3ae2834483bd53a00fbd425e (diff) | |
| download | ruby-cc2724c116a42bd9282b52d2386207013d2ed245.tar.gz ruby-cc2724c116a42bd9282b52d2386207013d2ed245.tar.xz ruby-cc2724c116a42bd9282b52d2386207013d2ed245.zip | |
* ext/json/ext/parser/parse.c: use ruby_xfree().
* ext/json/ext/parser/parse.rl: ditto.
* ext/json/ext/parser/unicode.c: ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/json/ext/parser/parser.c | 2 | ||||
| -rw-r--r-- | ext/json/ext/parser/parser.rl | 2 | ||||
| -rw-r--r-- | ext/json/ext/parser/unicode.c | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c index f2bedebea..fe85b26ce 100644 --- a/ext/json/ext/parser/parser.c +++ b/ext/json/ext/parser/parser.c @@ -1708,7 +1708,7 @@ static void JSON_mark(JSON_Parser *json) static void JSON_free(JSON_Parser *json) { - free(json); + ruby_xfree(json); } static VALUE cJSON_parser_s_allocate(VALUE klass) diff --git a/ext/json/ext/parser/parser.rl b/ext/json/ext/parser/parser.rl index c1f932d4b..8325a9379 100644 --- a/ext/json/ext/parser/parser.rl +++ b/ext/json/ext/parser/parser.rl @@ -588,7 +588,7 @@ static void JSON_mark(JSON_Parser *json) static void JSON_free(JSON_Parser *json) { - free(json); + ruby_xfree(json); } static VALUE cJSON_parser_s_allocate(VALUE klass) diff --git a/ext/json/ext/parser/unicode.c b/ext/json/ext/parser/unicode.c index a16ff262d..b2f1e5867 100644 --- a/ext/json/ext/parser/unicode.c +++ b/ext/json/ext/parser/unicode.c @@ -103,12 +103,12 @@ char *JSON_convert_UTF16_to_UTF8 ( + (ch2 - UNI_SUR_LOW_START) + halfBase; ++tmpPtr; } else if (flags == strictConversion) { /* it's an unpaired high surrogate */ - free(tmp); + ruby_xfree(tmp); rb_raise(rb_path2class("JSON::ParserError"), "source sequence is illegal/malformed near %s", source); } } else { /* We don't have the 16 bits following the high surrogate. */ - free(tmp); + ruby_xfree(tmp); rb_raise(rb_path2class("JSON::ParserError"), "partial character in source, but hit end near %s", source); break; @@ -116,7 +116,7 @@ char *JSON_convert_UTF16_to_UTF8 ( } else if (flags == strictConversion) { /* UTF-16 surrogate values are illegal in UTF-32 */ if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { - free(tmp); + ruby_xfree(tmp); rb_raise(rb_path2class("JSON::ParserError"), "source sequence is illegal/malformed near %s", source); } @@ -148,7 +148,7 @@ char *JSON_convert_UTF16_to_UTF8 ( } rb_str_buf_cat(buffer, p, bytesToWrite); } - free(tmp); + ruby_xfree(tmp); source += 5 + (n - 1) * 6; return source; } |
