z85 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/ext/z85/z85.c +8 -2
  3. data/lib/z85/version.rb +3 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b42cdc4d3ab6d389b80a598d1139e194142ee57a0f35fd2562aaecbeeb24173e
4
- data.tar.gz: e41d59835773468dd3a806e05378e1c83186bdfcc54a0a7caef92edcffef8093
3
+ metadata.gz: db559c519963849320043f3560f8a7971fed6d07a0cecee132d5286ce9d8a484
4
+ data.tar.gz: c394a65cefbb48fd7d6954816005bc325a26358a86b6b3eca88dad7e25db8714
5
5
  SHA512:
6
- metadata.gz: 0caf9cdb5e0800abc98795fe6ff7787bcc7e6d55fc9616789a955c8417b38852a28868f52794d869746a7e1ca11ca75c9d0815a4e9ad581b17d3b6f929ac5f9d
7
- data.tar.gz: d2e768aa2e8ecfbb8732b13dab5fc123bbfd2d970a782c437337b730168af7c5684893d8845d4b4d5caefcb706899369fd01e37ecefed274fcf040860bb07180
6
+ metadata.gz: 80169c9ecf71b235a45ebe7c0113b13fa699849cc7276f26b3c1e965e0e7a1598b3e4e7bf72b729dbc442862030bdc5046a59c36c8808e4f92a817995a5f9274
7
+ data.tar.gz: 5797ca4ed1c69a193ac1546434943cfd87400b651721a79ee23dc1120fbcd17bcbaf31ba478b2080768317804f76e01e6954fcd0b05e5ff8133364c4b8bd1924
@@ -87,7 +87,10 @@ static VALUE z85_encode(VALUE _mod, VALUE string)
87
87
  }
88
88
  encoded[char_nbr] = 0;
89
89
 
90
- return rb_str_export_locale(rb_str_new_cstr(encoded));
90
+ VALUE out = rb_str_export_locale(rb_str_new_cstr(encoded));
91
+ free(encoded);
92
+
93
+ return out;
91
94
  }
92
95
 
93
96
  static VALUE z85_decode(VALUE _mod, VALUE string)
@@ -116,7 +119,10 @@ static VALUE z85_decode(VALUE _mod, VALUE string)
116
119
  }
117
120
  }
118
121
 
119
- return rb_str_new((const char*) decoded, decoded_size);
122
+ VALUE out = rb_str_new((const char*) decoded, decoded_size);
123
+ free(decoded);
124
+
125
+ return out;
120
126
  }
121
127
 
122
128
  /* This function has a special name and it is invoked by Ruby to initialize the extension. */
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Z85
2
- VERSION = "0.2"
4
+ VERSION = "0.3"
3
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: z85
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xavier Noria