diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2014-05-26 14:23:35 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2014-05-26 14:53:30 +0200 |
commit | 7e840bf6481014eb0578742686193b541e784a30 (patch) | |
tree | d81406d808ac9e48abbed4fbe7d226f2d0a74166 | |
parent | 29336065f106b15f433c3c357f81207d3e811f8e (diff) |
When handling the DBus GetValue call,
ibusconfigservice.c:ibus_config_service_service_method_call()
gets a non-floating GVariant reference through
IBusConfigService::get_value() but never unrefs it.
Running ibus-dconf in valgrind and then running tests/ibus-config
shows this leak:
=28085== 232 (80 direct, 152 indirect) bytes in 2 blocks are definitely lost in loss record 2,025 of 2,121
==28085== at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28085== by 0x56EDDF2: g_malloc (gmem.c:97)
==28085== by 0x570691C: g_slice_alloc (gslice.c:1007)
==28085== by 0x572E6D9: g_variant_get_child_value (gvariant-core.c:1009)
==28085== by 0x57261C0: g_variant_get_variant (gvariant.c:715)
==28085== by 0x4C1A732: gvdb_table_value_from_item (gvdb-reader.c:578)
==28085== by 0x4C1A7A1: gvdb_table_get_value (gvdb-reader.c:610)
==28085== by 0x4C1589C: dconf_engine_read (dconf-engine.c:528)
==28085== by 0x4C14A79: dconf_client_read (dconf-client.c:242)
==28085== by 0x40286F: ibus_config_dconf_get_value (config.c:378)
==28085== by 0x4E44F29: ibus_config_service_service_method_call (ibusconfigservice.c:194)
==28085== by 0x4E33249: ibus_service_service_method_call_cb (ibusservice.c:395)
-rw-r--r-- | src/ibusconfigservice.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ibusconfigservice.c b/src/ibusconfigservice.c index 28db52e3..4b3c991b 100644 --- a/src/ibusconfigservice.c +++ b/src/ibusconfigservice.c @@ -195,6 +195,7 @@ ibus_config_service_service_method_call (IBusService *service, value = IBUS_CONFIG_SERVICE_GET_CLASS (config)->get_value (config, section, name, &error); if (value != NULL) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("(v)", value)); + g_variant_unref (value); } else { g_dbus_method_invocation_return_gerror (invocation, error); |