mirror of
https://github.com/profanity-im/profanity.git
synced 2024-10-13 20:13:38 -04:00
Use g_list_free() when finding resource availability
This commit is contained in:
parent
7872d8e14f
commit
8cf7122e7a
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user