diff options
author | Philip Withnall <withnall@endlessm.com> | 2017-12-15 16:23:50 +0000 |
---|---|---|
committer | Philip Withnall <withnall@endlessm.com> | 2017-12-15 16:23:50 +0000 |
commit | 43b9703970a6d5f2fc53f828ab8d29195ab01583 (patch) | |
tree | 134630d4d3e97f7f1117b21beeefceac4a493a3b /json-glib/tests/serialize-complex.c | |
parent | 96d591b5708ef9dfb4c02d2ae39b891f903d8a58 (diff) | |
download | json-glib-43b9703970a6d5f2fc53f828ab8d29195ab01583.tar.gz |
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 <withnall@endlessm.com>
https://gitlab.gnome.org/GNOME/json-glib/issues/30
Diffstat (limited to 'json-glib/tests/serialize-complex.c')
-rw-r--r-- | json-glib/tests/serialize-complex.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/json-glib/tests/serialize-complex.c b/json-glib/tests/serialize-complex.c index 9da8dd1..226e722 100644 --- a/json-glib/tests/serialize-complex.c +++ b/json-glib/tests/serialize-complex.c @@ -263,7 +263,7 @@ test_serialize (void) "baz", "Hello, World!", "meh", 0.5, NULL); - 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); } int |