summaryrefslogtreecommitdiff
path: root/src/agent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/agent.c')
-rwxr-xr-x[-rw-r--r--]src/agent.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/agent.c b/src/agent.c
index a340026..bdeb0e7 100644..100755
--- a/src/agent.c
+++ b/src/agent.c
@@ -502,7 +502,7 @@ void connman_agent_cancel(void *user_context)
g_hash_table_iter_init(&iter, agent_hash);
while (g_hash_table_iter_next(&iter, &key, &value)) {
- GList *list;
+ GList *list, *next;
struct connman_agent *agent = value;
/*
@@ -512,6 +512,8 @@ void connman_agent_cancel(void *user_context)
while (list) {
struct connman_agent_request *request = list->data;
+ next = list->next;
+
if (request && request->user_context &&
request->user_context ==
user_context) {
@@ -521,10 +523,11 @@ void connman_agent_cancel(void *user_context)
agent_request_free(request);
- agent->queue = list->next;
- list = g_list_delete_link(list, list);
- } else
- list = list->next;
+ agent->queue = g_list_delete_link(agent->queue,
+ list);
+ }
+
+ list = next;
}
/*