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 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 = ALLOCA_N(uint8_t, 4 * RSTRING_LEN(string));
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
 
@@ -1,3 +1,3 @@
1
1
  module Cmultibyte
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cmultibyte
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Burke Libbey