talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 94522bfdafad5e4d36bfadd65e626ca8540119fa
parent 8c9594c5e8783d2dbd4c27f4366a1bf398459e49
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Wed, 13 Mar 2019 20:54:20 +0100

Fix two small memory leaks in addressbook code

In each case, the GList structure itself was not
being freed.

Diffstat:
Msrc/addrbook.c | 5++---
Msrc/editgroup.c | 3+--
2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/addrbook.c b/src/addrbook.c @@ -1606,7 +1606,7 @@ static void addrbook_build_avail_email_vis(gpointer key, gpointer value, /** * Return link list of available email items that have not already been linked * to groups. Note that the list contains references to items and should be - * <code>g_free()</code> when done. Do <b>*NOT*</b> attempt to used the + * <code>g_list_free()</code> when done. Do <b>*NOT*</b> attempt to used the * <code>addrbook_free_xxx()<code> functions... this will destroy the * addressbook data! * @@ -1672,8 +1672,7 @@ void addrbook_update_group_list(AddressBookFile *book, ItemGroup *group, /* Remember old list */ oldData = group->listEMail; group->listEMail = listEMail; - mgu_clear_list(oldData); - oldData = NULL; + g_list_free(oldData); } /** diff --git a/src/editgroup.c b/src/editgroup.c @@ -506,8 +506,7 @@ ItemGroup *addressbook_edit_group( AddressBookFile *abf, ItemFolder *parent, Ite listEMail = addrbook_get_available_email_list( abf, group ); edit_group_load_clist( groupeditdlg.clist_avail, listEMail ); - mgu_clear_list( listEMail ); - listEMail = NULL; + g_list_free( listEMail ); gtk_cmclist_select_row( groupeditdlg.clist_group, 0, 0 ); gtk_cmclist_select_row( groupeditdlg.clist_avail, 0, 0 );