lua-yajl
lua-yajl copied to clipboard
Memory leak in js_to_value
If one of the js_parser_assert conditions fails, the parser handle is leaked. This can be tested by adding an invalid json string to the test script.
handle = <span class="pl-c1">yajl_alloc</span>(&js_to_value_callbacks, <span class="pl-c1">NULL</span>, (<span class="pl-k">void</span>*)L);
This handle needs to be encapsulated in a userdata, the way the handle js_parser is, with a gc function so it is freed when the object is garbage collected.