item: Fix local variable leak in on_create_path()

This fixes:
==22678== 48 bytes in 1 blocks are definitely lost in loss record 1,045 of 1,560
==22678==    at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22678==    by 0x6002FCC: g_malloc (gmem.c:94)
==22678==    by 0x60032AE: g_malloc_n (gmem.c:330)
==22678==    by 0x601DBF0: g_strdup (gstrfuncs.c:363)
==22678==    by 0x4E6508B: on_create_item_called (secret-paths.c:1991)
==22678==    by 0x5A3346D: g_task_return_now (gtask.c:1104)
==22678==    by 0x5A33575: g_task_return (gtask.c:1162)
==22678==    by 0x5A33E76: g_task_return_pointer (gtask.c:1537)
==22678==    by 0x5A9BB7D: g_dbus_connection_call_done (gdbusconnection.c:5704)
==22678==    by 0x5A3346D: g_task_return_now (gtask.c:1104)
==22678==    by 0x5A334B6: complete_in_idle_cb (gtask.c:1118)
==22678==    by 0x5FFD3D0: g_idle_dispatch (gmain.c:5441)
==22678==    by 0x5FFAA18: g_main_dispatch (gmain.c:3154)
==22678==    by 0x5FFB85C: g_main_context_dispatch (gmain.c:3769)
==22678==    by 0x5FFBA40: g_main_context_iterate (gmain.c:3840)
==22678==    by 0x5FFBE66: g_main_loop_run (gmain.c:4034)
==22678==    by 0x4E7C9E4: loop_wait_until (egg-testing.c:151)
==22678==    by 0x4E7C85C: egg_test_wait_until (egg-testing.c:105)
==22678==    by 0x402D22: test_create_async (test-item.c:245)
==22678==    by 0x60258FA: test_case_run (gtestutils.c:2158)
==22678==    by 0x6025CBB: g_test_run_suite_internal (gtestutils.c:2241)
==22678==    by 0x6025D64: g_test_run_suite_internal (gtestutils.c:2253)
==22678==    by 0x6025F7B: g_test_run_suite (gtestutils.c:2328)
==22678==    by 0x6024C1C: g_test_run (gtestutils.c:1596)
==22678==    by 0x4E7CA3E: egg_tests_run_with_loop (egg-testing.c:167)
==22678==    by 0x406B52: main (test-item.c:887)

https://bugzilla.gnome.org/show_bug.cgi?id=756766
This commit is contained in:
Christophe Fergeau 2015-10-17 22:59:45 +02:00
parent 2c5567cd65
commit 6fbfb64b17

View File

@ -717,6 +717,7 @@ on_create_path (GObject *source,
g_simple_async_result_take_error (res, error);
g_simple_async_result_complete (res);
}
g_free (path);
g_object_unref (res);
}