cmultibyte 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/cmultibyte.c +2 -1
- data/lib/cmultibyte/version.rb +1 -1
- metadata +1 -1
data/ext/cmultibyte.c
CHANGED
@@ -92,7 +92,7 @@ static VALUE tidy_bytes(VALUE string) {
|
|
92
92
|
int i, j;
|
93
93
|
uint8_t byte;
|
94
94
|
|
95
|
-
uint8_t *arr =
|
95
|
+
uint8_t *arr = ALLOC_N(uint8_t, 4 * RSTRING_LEN(string));
|
96
96
|
uint8_t *curr = arr;
|
97
97
|
uint8_t *prev = curr;
|
98
98
|
uint8_t *last_lead = curr;
|
@@ -155,6 +155,7 @@ static VALUE tidy_bytes(VALUE string) {
|
|
155
155
|
}
|
156
156
|
}
|
157
157
|
VALUE str = rb_str_new((const char *)arr, curr-arr);
|
158
|
+
xfree(arr);
|
158
159
|
return str;
|
159
160
|
}
|
160
161
|
|
data/lib/cmultibyte/version.rb
CHANGED