diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2014-05-23 15:16:15 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2014-05-23 21:38:01 +0200 |
commit | 7477c860e9e9d036b7a7e1088898394b25fb828a (patch) | |
tree | 6a60e75daf2c46d6d3400fc75fc0e1f2a103a616 | |
parent | a2757b8d66a7211f07ddb564dec1bc7774b15292 (diff) |
Fix g_dbus_proxy_get_name_owner() leaks
-rw-r--r-- | src/ibusconfig.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ibusconfig.c b/src/ibusconfig.c index 4e76cfa4..621a4e53 100644 --- a/src/ibusconfig.c +++ b/src/ibusconfig.c @@ -287,6 +287,7 @@ ibus_config_new (GDBusConnection *connection, g_assert (G_IS_DBUS_CONNECTION (connection)); GInitable *initable; + char *owner; GDBusProxyFlags flags = G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | @@ -305,7 +306,8 @@ ibus_config_new (GDBusConnection *connection, if (initable == NULL) return NULL; - if (g_dbus_proxy_get_name_owner (G_DBUS_PROXY (initable)) == NULL) { + owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (initable)); + if (owner == NULL) { /* The configuration daemon, which is usually ibus-gconf, is not started yet. */ g_set_error (error, IBUS_ERROR, @@ -314,6 +316,7 @@ ibus_config_new (GDBusConnection *connection, g_object_unref (initable); return NULL; } + g_free (owner); /* clients should not destroy the config service. */ IBUS_PROXY (initable)->own = FALSE; @@ -367,7 +370,9 @@ ibus_config_new_async_finish (GAsyncResult *res, g_object_unref (source_object); if (object != NULL) { - if (g_dbus_proxy_get_name_owner (G_DBUS_PROXY (object)) == NULL) { + char *owner; + owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (object)); + if (owner == NULL) { /* The configuration daemon, which is usually ibus-gconf, * is not started yet. */ g_set_error (error, @@ -377,6 +382,7 @@ ibus_config_new_async_finish (GAsyncResult *res, g_object_unref (object); return NULL; } + g_free (owner); /* clients should not destroy the config service. */ IBUS_PROXY (object)->own = FALSE; return IBUS_CONFIG (object); |