secret-agent: fix leak of @dbus_owner

The @dbus_owner field was only cleaned up when the
proxy disconnected and leaked otherwise.

Also, don't clear @dbus_owner together with the proxy.
Otherwise, get_description() might yield different results
after the proxy got cleared. That can lead to problems because
NMAgentManager tracks the secrets agents by their "dbus-owner" --
IOW, NMAgentManager uses the "dbus-owner" as identifer for the
secret agent. Thus it must not change.

Fixes: 2a2fd1216b
This commit is contained in:
Thomas Haller 2015-08-21 23:22:08 +02:00
parent 6bcc1eda0b
commit 8ed98a381b

View file

@ -470,8 +470,6 @@ name_owner_changed_cb (GObject *proxy,
g_signal_handlers_disconnect_by_func (priv->proxy, name_owner_changed_cb, self);
g_clear_object (&priv->proxy);
g_signal_emit (self, signals[DISCONNECTED], 0);
g_clear_pointer (&priv->dbus_owner, g_free);
} else
g_free (owner);
}
@ -555,6 +553,7 @@ finalize (GObject *object)
g_free (priv->description);
g_free (priv->identifier);
g_free (priv->owner_username);
g_free (priv->dbus_owner);
g_slist_free_full (priv->permissions, g_free);
g_hash_table_destroy (priv->requests);