[libsecret] prompt: Don't leak 'owner_name' in secret_prompt_perform()



commit b6189a95e9a3f518f54b617456218a3e3114199b
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Sat Oct 17 23:06:35 2015 +0200

    prompt: Don't leak 'owner_name' in secret_prompt_perform()
    
    This fixes:
    ==16832== 7 bytes in 1 blocks are definitely lost in loss record 10 of 1,184
    ==16832==    at 0x4A06C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==16832==    by 0x36E564F679: g_malloc (gmem.c:97)
    ==16832==    by 0x36E56688AE: g_strdup (gstrfuncs.c:356)
    ==16832==    by 0x36E6EDEB98: g_dbus_proxy_get_name_owner (gdbusproxy.c:2372)
    ==16832==    by 0x4C38B64: secret_prompt_perform (secret-prompt.c:468)
    ==16832==    by 0x4C39F4C: secret_service_real_prompt_async (secret-service.c:339)
    ==16832==    by 0x4C3D126: secret_service_prompt (secret-service.c:1711)
    ==16832==    by 0x4C42182: on_create_collection_called (secret-paths.c:1706)
    ==16832==    by 0x36E6E74BA6: g_simple_async_result_complete (gsimpleasyncresult.c:763)
    ==16832==    by 0x36E6ED1921: g_dbus_connection_call_done (gdbusconnection.c:5508)
    ==16832==    by 0x36E6E74BA6: g_simple_async_result_complete (gsimpleasyncresult.c:763)
    ==16832==    by 0x36E6E74C08: complete_in_idle_cb (gsimpleasyncresult.c:775)
    ==16832==    by 0x36E5649A89: g_main_dispatch (gmain.c:3122)
    ==16832==    by 0x36E5649A89: g_main_context_dispatch (gmain.c:3737)
    ==16832==    by 0x36E5649E1F: g_main_context_iterate.isra.29 (gmain.c:3808)
    ==16832==    by 0x36E564A141: g_main_loop_run (gmain.c:4002)
    ==16832==    by 0x4C427F1: secret_service_create_collection_dbus_path_sync (secret-paths.c:1908)
    ==16832==    by 0x4C299F9: secret_collection_create_sync (secret-collection.c:1211)
    ==16832==    by 0x403084: test_create_sync (test-collection.c:299)
    ==16832==    by 0x36E566FB92: test_case_run (gtestutils.c:2124)
    ==16832==    by 0x36E566FB92: g_test_run_suite_internal (gtestutils.c:2185)
    ==16832==    by 0x36E566FD5A: g_test_run_suite_internal (gtestutils.c:2196)
    ==16832==    by 0x36E56700DA: g_test_run_suite (gtestutils.c:2249)
    ==16832==    by 0x36E5670110: g_test_run (gtestutils.c:1553)
    ==16832==    by 0x4C5A0EA: egg_tests_run_with_loop (egg-testing.c:167)
    ==16832==    by 0x4068B0: main (test-collection.c:1028)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756766

 libsecret/secret-prompt.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libsecret/secret-prompt.c b/libsecret/secret-prompt.c
index a1724fe..4c6aeda 100644
--- a/libsecret/secret-prompt.c
+++ b/libsecret/secret-prompt.c
@@ -437,7 +437,7 @@ secret_prompt_perform (SecretPrompt *self,
 {
        GSimpleAsyncResult *res;
        PerformClosure *closure;
-       const gchar *owner_name;
+       gchar *owner_name;
        const gchar *object_path;
        gboolean prompted;
        GDBusProxy *proxy;
@@ -494,6 +494,7 @@ secret_prompt_perform (SecretPrompt *self,
                           closure->call_cancellable, on_prompt_prompted, g_object_ref (res));
 
        g_object_unref (res);
+       g_free (owner_name);
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]