mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-19 21:56:21 +00:00
Use g_list_free() when finding resource availability
This commit is contained in:
@@ -223,11 +223,12 @@ _get_most_available_resource(PContact contact)
|
||||
// xa
|
||||
// dnd
|
||||
GList *resources = g_hash_table_get_values(contact->available_resources);
|
||||
Resource *current = resources->data;
|
||||
GList *curr = resources;
|
||||
Resource *current = curr->data;
|
||||
Resource *highest = current;
|
||||
resources = g_list_next(resources);
|
||||
while (resources != NULL) {
|
||||
current = resources->data;
|
||||
curr = g_list_next(curr);
|
||||
while (curr != NULL) {
|
||||
current = curr->data;
|
||||
|
||||
// priority is same as current highest, choose presence
|
||||
if (current->priority == highest->priority) {
|
||||
@@ -238,9 +239,9 @@ _get_most_available_resource(PContact contact)
|
||||
highest = current;
|
||||
}
|
||||
|
||||
resources = g_list_next(resources);
|
||||
curr = g_list_next(curr);
|
||||
}
|
||||
free(resources);
|
||||
g_list_free(resources);
|
||||
|
||||
return highest;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user