summary refs log tree commit diff
path: root/src/settings/nm-agent-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/nm-agent-manager.c')
-rw-r--r--src/settings/nm-agent-manager.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/settings/nm-agent-manager.c b/src/settings/nm-agent-manager.c
index cc4b1943..8dcda06d 100644
--- a/src/settings/nm-agent-manager.c
+++ b/src/settings/nm-agent-manager.c
@@ -330,6 +330,7 @@ impl_agent_manager_register_with_capabilities (NMAgentManager *self,
 
 		priv->chains = g_slist_append (priv->chains, chain);
 	} else {
+		g_object_unref (agent);
 		error = g_error_new_literal (NM_AGENT_MANAGER_ERROR,
 		                             NM_AGENT_MANAGER_ERROR_FAILED,
 		                             "Unable to start agent authentication.");
@@ -602,11 +603,12 @@ request_next_agent (Request *req)
 {
 	GError *error = NULL;
 
+	req->current_call_id = NULL;
+	if (req->current)
+		g_object_unref (req->current);
+
 	if (req->pending) {
 		/* Send the request to the next agent */
-		req->current_call_id = NULL;
-		if (req->current)
-			g_object_unref (req->current);
 		req->current = req->pending->data;
 		req->pending = g_slist_remove (req->pending, req->current);
 
@@ -616,7 +618,6 @@ request_next_agent (Request *req)
 
 		req->next_callback (req);
 	} else {
-		req->current_call_id = NULL;
 		req->current = NULL;
 
 		/* No more secret agents are available to fulfill this secrets request */