romanbsd-jsmin-ffi 0.1.0 → 0.1.1

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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/ext/jsmin.cpp +4 -1
  3. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/ext/jsmin.cpp CHANGED
@@ -110,6 +110,7 @@ int Jsmin::next()
110
110
  }
111
111
  break;
112
112
  case 0:
113
+ free(output_buf);
113
114
  throw("!Unterminated comment");
114
115
  }
115
116
  }
@@ -148,6 +149,7 @@ void Jsmin::action(int d)
148
149
  theA = get();
149
150
  }
150
151
  if (theA == 0) {
152
+ free(output_buf);
151
153
  throw("!Unterminated string literal");
152
154
  }
153
155
  }
@@ -171,6 +173,7 @@ void Jsmin::action(int d)
171
173
  theA = get();
172
174
  }
173
175
  if (theA == 0) {
176
+ free(output_buf);
174
177
  throw("!Unterminated Regular Expression literal");
175
178
  }
176
179
  output_buf[index_out++] = theA;
@@ -278,7 +281,7 @@ extern "C" {
278
281
  out = m->minify(in);
279
282
  }
280
283
  catch (char const *e) {
281
- out = (char*) e;
284
+ out = strdup(e);
282
285
  }
283
286
  delete(m);
284
287
  return out;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: romanbsd-jsmin-ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Shterenzon