if( ! addrselect_test_empty( _addressSelect_ ) ) {
listAddress = addrselect_build_list( _addressSelect_ );
compose_new_with_list( NULL, listAddress );
- mgu_free_dlist( listAddress );
+ g_list_free_full( listAddress, g_free );
listAddress = NULL;
}
}
}
buf = mgu_list_coalesce( list );
- mgu_free_list( list );
+ g_slist_free_full( list, g_free );
if(( p = strchr( buf, ':' ) ) != NULL ) {
addr = p + 1;
else {
addrharvest_harvest_list( harvester, cache, listHdr, msgList );
}
- mgu_free_dlist( listHdr );
+ g_list_free_full( listHdr, g_free );
#ifndef USE_ALT_ADDRBOOK
/* Mark cache */
rc = xml_parse_next_tag( file );
if( rc != 0 ) {
/* Terminate prematurely */
- mgu_free_dlist( list );
+ g_list_free_full( list, g_free );
list = NULL;
return;
}
}
}
-/*
-* Free linked list of character strings.
-*/
-void mgu_free_list( GSList *list ) {
- GSList *node = list;
- while( node ) {
- g_free( node->data );
- node->data = NULL;
- node = g_slist_next( node );
- }
- g_slist_free( list );
-}
-
-/*
-* Free linked list of character strings.
-*/
-void mgu_free_dlist( GList *list ) {
- GList *node = list;
- while( node ) {
- g_free( node->data );
- node->data = NULL;
- node = g_list_next( node );
- }
- g_list_free( list );
-}
-
/*
* Coalesce linked list of characaters into one long string.
*/
/* Function prototypes */
void mgu_print_list ( GSList *list, FILE *stream );
void mgu_print_dlist ( GList *list, FILE *stream );
-void mgu_free_list ( GSList *list );
-void mgu_free_dlist ( GList *list );
gchar *mgu_list_coalesce ( GSList *list );
gchar *mgu_replace_string ( gchar *str, const gchar *value );
gchar *mgu_email_check_empty ( gchar *address );
done = TRUE;
}
}
- mgu_free_dlist( customLbl );
+ g_list_free_full( customLbl, g_free );
customLbl = NULL;
}
}
node = g_list_next( node );
}
- mgu_free_dlist( baseDN );
+ g_list_free_full( baseDN, g_free );
baseDN = node = NULL;
flg = TRUE;
} else {
if (gtk_tree_model_get_iter_first(model, &iter))
gtk_tree_selection_select_iter(sel, &iter);
- mgu_free_dlist( baseDN );
+ g_list_free_full( baseDN, g_free );
baseDN = node = NULL;
}
ldapedit_basedn_bad_server = FALSE;
cm_return_if_fail( pilotFile != NULL );
/* Release custom labels */
- mgu_free_dlist( pilotFile->customLabels );
+ g_list_free_full( pilotFile->customLabels, g_free );
pilotFile->customLabels = NULL;
/* Release indexes */
addrcache_person_add_email( pilotFile->addressCache, person, email );
node = g_list_next( node );
}
- mgu_free_dlist( list );
+ g_list_free_full( list, g_free );
list = NULL;
}
}
*/
void ldapctl_criteria_list_clear( LdapControl *ctl ) {
cm_return_if_fail( ctl != NULL );
- mgu_free_dlist( ctl->listCriteria );
+ g_list_free_full( ctl->listCriteria, g_free );
ctl->listCriteria = NULL;
}
GSList *listLast, GSList *listDisplay, GSList *other_attrs )
{
GSList *cur = other_attrs;
- mgu_free_list( listName );
- mgu_free_list( listAddr );
- mgu_free_list( listFirst );
- mgu_free_list( listLast );
- mgu_free_list( listDisplay );
+ g_slist_free_full( listName, g_free );
+ g_slist_free_full( listAddr, g_free );
+ g_slist_free_full( listFirst, g_free );
+ g_slist_free_full( listLast, g_free );
+ g_slist_free_full( listDisplay, g_free );
for(;cur; cur = cur->next)
addritem_free_attribute((UserAttribute *)cur->data);
g_slist_free(other_attrs);
addritem_attrib_set_value( attrib, attvalue );
other_attrs = g_slist_prepend(other_attrs, attrib);
}
- mgu_free_list(attlist);
+ g_slist_free_full(attlist, g_free);
}
/* Free memory used to store attribute */
ldap_memfree( attribute );
ldif_build_items( ldifFile, rec, cache );
ldif_clear_rec( rec );
g_free( lastTag );
- mgu_free_list( listValue );
+ g_slist_free_full( listValue, g_free );
g_free(fullValue);
lastTag = NULL;
listValue = NULL;
rec, lastTag, fullValue,
hashField );
g_free( lastTag );
- mgu_free_list( listValue );
+ g_slist_free_full( listValue, g_free );
lastTag = NULL;
listValue = NULL;
}
ldif_clear_rec( rec );
g_free( rec );
g_free( lastTag );
- mgu_free_list( listValue );
+ g_slist_free_full( listValue, g_free );
}
/**
ldif_hash_add_list(
ldifFile->hashFields, listTags );
}
- mgu_free_list( listTags );
+ g_slist_free_full( listTags, g_free );
listTags = NULL;
flagMail = FALSE;
}
}
/* Release data */
- mgu_free_list( listTags );
+ g_slist_free_full( listTags, g_free );
listTags = NULL;
}
list = mgu_parse_string( line, 3, &tCount );
if( tCount < 3 ) {
if( list ) {
- mgu_free_dlist( list );
+ g_list_free_full( list, g_free );
list = NULL;
}
return;
mutt_build_address( muttFile, cache, aliasName, addrList, aCount );
}
- mgu_free_dlist( list );
+ g_list_free_full( list, g_free );
list = NULL;
}
}
g_free( lineValue );
lineValue = NULL;
- mgu_free_list( listValue );
+ g_slist_free_full( listValue, g_free );
listValue = NULL;
}
lastCont = flagCont;
}
/* Release data */
- mgu_free_list( listValue );
+ g_slist_free_full( listValue, g_free );
listValue = NULL;
}
}
g_free( lineValue );
lineValue = NULL;
- mgu_free_list( listValue );
+ g_slist_free_full( listValue, g_free );
listValue = NULL;
}
if( line != NULL ) {
}
/* Release data */
- mgu_free_list( listValue );
+ g_slist_free_full( listValue, g_free );
listValue = NULL;
}
* Free linked lists of character strings.
*/
static void vcard_free_lists( GSList *listName, GSList *listAddr, GSList *listRem, GSList* listID ) {
- mgu_free_list( listName );
- mgu_free_list( listAddr );
- mgu_free_list( listRem );
- mgu_free_list( listID );
+ g_slist_free_full( listName, g_free );
+ g_slist_free_full( listAddr, g_free );
+ g_slist_free_full( listRem, g_free );
+ g_slist_free_full( listID, g_free );
}
/*
line = mgu_list_coalesce( listQP );
/* Clean up */
- mgu_free_list( listQP );
+ g_slist_free_full( listQP, g_free );
listQP = NULL;
return line;
}