Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed double free bug

  • Loading branch information...
commit 0e7afa0b1001d186681da98f1012b8076b214ccc 1 parent 48d57be
Peter Ohler authored
Showing with 6 additions and 2 deletions.
  1. +4 −0 README.md
  2. +1 −1  ext/oj/fast.c
  3. +1 −1  lib/oj/version.rb
4 README.md
@@ -32,6 +32,10 @@ A fast JSON parser and Object marshaller as a Ruby gem.
## <a name="release">Release Notes</a>
+### Release 1.2.13
+
+ - Fixed double free bug in Oj::Doc that showed up for larger documents.
+
### Release 1.2.12
- Fixed GC bug in Oj::Doc, the fast parser.
View
2  ext/oj/fast.c
@@ -847,7 +847,7 @@ parse_json(VALUE clas, char *json, int given, int allocated) {
rb_gc_unregister_address(&doc->self);
DATA_PTR(doc->self) = 0;
doc_free(pi.doc);
- if (allocated) {
+ if (allocated && 0 != ex) { // will jump so caller will not free
xfree(json);
}
} else {
View
2  lib/oj/version.rb
@@ -1,5 +1,5 @@
module Oj
# Current version of the module.
- VERSION = '1.2.12'
+ VERSION = '1.2.13'
end
Please sign in to comment.
Something went wrong with that request. Please try again.