aboutsummaryrefslogtreecommitdiff
path: root/src/ui/new_group.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/new_group.c')
-rw-r--r--src/ui/new_group.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/ui/new_group.c b/src/ui/new_group.c
index ea19371..6355fcd 100644
--- a/src/ui/new_group.c
+++ b/src/ui/new_group.c
@@ -207,7 +207,7 @@ void
207ui_new_group_dialog_init(MESSENGER_Application *app, 207ui_new_group_dialog_init(MESSENGER_Application *app,
208 UI_NEW_GROUP_Handle *handle) 208 UI_NEW_GROUP_Handle *handle)
209{ 209{
210 handle->contact_entries = g_list_alloc(); 210 handle->contact_entries = NULL;
211 211
212 handle->builder = gtk_builder_new_from_file("resources/ui/new_group.ui"); 212 handle->builder = gtk_builder_new_from_file("resources/ui/new_group.ui");
213 213
@@ -340,14 +340,9 @@ ui_new_group_dialog_cleanup(UI_NEW_GROUP_Handle *handle)
340{ 340{
341 g_object_unref(handle->builder); 341 g_object_unref(handle->builder);
342 342
343 GList *list = handle->contact_entries; 343 for (GList *list = handle->contact_entries; list; list = list->next)
344 ui_contact_entry_delete((UI_CONTACT_ENTRY_Handle*) list->data);
344 345
345 while (list) { 346 if (handle->contact_entries)
346 if (list->data) 347 g_list_free(handle->contact_entries);
347 ui_contact_entry_delete((UI_CONTACT_ENTRY_Handle*) list->data);
348
349 list = list->next;
350 }
351
352 g_list_free(handle->contact_entries);
353} 348}