From: Andrew Kelley Date: Tue, 2 Apr 2019 09:29:53 -0400 Subject: add project to README and fix memory leak in example See #1 Applied-Upstream: https://github.com/andrewrk/liblaxjson/commit/0c04d700a039ac54adfbfeacdb9be95cbba5c81c --- README.md | 1 + example/token_list.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 5efc4fd..3ed521d 100644 --- a/README.md +++ b/README.md @@ -145,3 +145,4 @@ Feel free to make a pull request adding to this list. * [rucksack](https://github.com/andrewrk/rucksack) - a texture packer and resource bundler * [Genesis](https://github.com/andrewrk/genesis) - digital audio workstation + * [lua-laxjson](https://github.com/sjnam/lua-laxjson) - Lua bindings diff --git a/example/token_list.c b/example/token_list.c index 59dc6ce..b994adb 100644 --- a/example/token_list.c +++ b/example/token_list.c @@ -71,12 +71,14 @@ int main() { if ((err = lax_json_feed(context, amt_read, buf))) { fprintf(stderr, "Line %d, column %d: %s\n", context->line, context->column, lax_json_str_err(err)); + lax_json_destroy(context); return -1; } } if ((err = lax_json_eof(context))) { fprintf(stderr, "Line %d, column %d: %s\n", context->line, context->column, lax_json_str_err(err)); + lax_json_destroy(context); return -1; } lax_json_destroy(context);