cmultibyte 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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