[gobject-introspection] tests: Fix memory leak in gi_marshalling_tests_init_function()
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] tests: Fix memory leak in gi_marshalling_tests_init_function()
- Date: Mon, 4 Mar 2013 10:00:53 +0000 (UTC)
commit a49d4b3f64d5d37d3844ad0107968124c0a1d503
Author: Martin Pitt <martinpitt gnome org>
Date: Mon Mar 4 10:59:22 2013 +0100
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.
tests/gimarshallingtests.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index 0869a9a..dc7fabd 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]