summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-03-04 10:59:22 +0100
committerMartin Pitt <martinpitt@gnome.org>2013-03-04 10:59:22 +0100
commita49d4b3f64d5d37d3844ad0107968124c0a1d503 (patch)
tree66117d842139a775ea0f5d8b4cf46383191d462d
parent9c1d1813223346b17cfee0383bf026b2c93c385f (diff)
downloadgobject-introspection-a49d4b3f64d5d37d3844ad0107968124c0a1d503.tar.gz
tests: Fix memory leak in gi_marshalling_tests_init_function()
In gi_marshalling_tests_init_function(), free the array string element before removing it. This fixes the memory leak in PyGObject's test_gi.TestArray.test_init_function test.
-rw-r--r--tests/gimarshallingtests.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index 0869a9a2..dc7fabd6 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -1156,6 +1156,8 @@ gi_marshalling_tests_init_function (gint *n_args, char ***argv)
return TRUE;
(*n_args)--;
g_assert (argv != NULL);
+ /* we have transfer ownership full, so we need to free the element ourself */
+ g_free ((*argv)[*n_args]);
(*argv)[*n_args] = NULL;
return TRUE;
}