vfunc arguments are leaked: test_object_vfuncs
Submitted by Martin Pitt
Link to original bug (#695129)
Description
The test_gi.TestPythonGObject.test_callback_in_vfunc test case leaks its string return values:
==24737== 6 bytes in 1 blocks are definitely lost in loss record 14 of 4,791 ==24737== at 0x4C2CD7B: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==24737== by 0xAC737AF: standard_malloc (gmem.c:85) ==24737== by 0xAC73838: g_malloc (gmem.c:159) ==24737== by 0xAC73B3E: g_malloc_n (gmem.c:400) ==24737== by 0xAC8EE21: g_strdup (gstrfuncs.c:364) ==24737== by 0xA539136: _pygi_argument_from_object (pygi-argument.c:1098) ==24737== by 0xA540D23: _pygi_closure_assign_pyobj_to_retval (pygi-closure.c:35) ==24737== by 0xA5426C6: _pygi_closure_set_out_arguments (pygi-closure.c:409) ==24737== by 0xA542D23: _pygi_closure_handle (pygi-closure.c:505) ==24737== by 0xB7229F6: ffi_closure_unix64_inner (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.1) ==24737== by 0xB722D7F: ffi_closure_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.1) ==24737== by 0xD5F8D15: gi_marshalling_tests_object_method_str_arg_out_ret (gimarshallingtests.c:4081) ==24737== ==24737== LEAK SUMMARY: ==24737== definitely lost: 6 bytes in 1 blocks ==24737== indirectly lost: 0 bytes in 0 blocks
This is happening here:
self.assertEqual(object_.method_str_arg_out_ret('hello'), ('HELLO', 5))