Commit 96d591b5 authored by Philip Withnall's avatar Philip Withnall

json-parser: Fix a memory leak on two error handling paths

Small leak. With some additional fixes to the tests themselves, this
makes all the tests run valgrind-clean. (See the following commit.)
Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>

#30
parent 32f87359
......@@ -746,6 +746,7 @@ json_parse_object (JsonParser *parser,
{
priv->error_code = JSON_PARSER_ERROR_TRAILING_COMMA;
g_free (name);
json_object_unref (object);
json_node_unref (member);
json_node_unref (priv->current_node);
......@@ -758,6 +759,7 @@ json_parse_object (JsonParser *parser,
{
priv->error_code = JSON_PARSER_ERROR_MISSING_COMMA;
g_free (name);
json_object_unref (object);
json_node_unref (member);
json_node_unref (priv->current_node);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment