Permalink
Browse files

fix memory leak

  • Loading branch information...
1 parent 7443757 commit 7d49544ec6dc326cef4008ff6f1514d2ce1f8c2d @brianmario committed Jan 11, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 ext/yajl/yajl_ext.c
View
@@ -223,8 +223,9 @@ void yajl_parse_chunk(const unsigned char * chunk, unsigned int len, yajl_handle
if (stat != yajl_status_ok && stat != yajl_status_insufficient_data) {
unsigned char * str = yajl_get_error(parser, 1, chunk, len);
- rb_raise(cParseError, "%s", (const char *) str);
+ VALUE errobj = rb_exc_new2(cParseError, (const char*) str);
yajl_free_error(parser, str);
+ rb_exc_raise(errobj);
}
}

0 comments on commit 7d49544

Please sign in to comment.