Commit 58dd18e0 authored by Philip Withnall's avatar Philip Withnall Committed by Emmanuele Bassi

tests: Fix some memory leaks in the tests

We can’t do this by porting to g_autoptr(), because json-glib needs to
be buildable using MSVC. Sad panda.
Signed-off-by: Philip Withnall's avatarPhilip Withnall <>

(cherry picked from commit 43b97039)
Signed-off-by: default avatarEmmanuele Bassi <>
parent 15304031
......@@ -215,6 +215,7 @@ path_expressions_invalid (gconstpointer data)
g_assert_error (error, JSON_PATH_ERROR, code);
g_object_unref (path);
g_clear_error (&error);
static void
......@@ -133,6 +133,8 @@ test_base_array (void)
g_assert (json_reader_get_error (reader) == NULL);
g_object_unref (reader);
g_object_unref (parser);
g_clear_error (&error);
static void
......@@ -263,7 +263,7 @@ test_serialize (void)
"baz", "Hello, World!",
"meh", 0.5,
JsonParser *parser = json_parser_new ();
JsonParser *parser = NULL;
GError *error = NULL;
JsonObject *object;
JsonNode *node;
......@@ -295,6 +295,7 @@ test_serialize (void)
g_free (data);
g_object_unref (parser);
g_object_unref (obj);
g_clear_error (&error);
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