[evolution-ews/gnome-3-8] Fix leak of strings in e_book_backend_ews_get_backend_property()



commit 9c899ef9e66750ad6a14831d2d2c9cbe00d7aa06
Author: David Woodhouse <David Woodhouse intel com>
Date:   Mon Jun 10 14:32:29 2013 +0100

    Fix leak of strings in e_book_backend_ews_get_backend_property()
    
    This doesn't happen on master where the API has been made somewhat saner,
    which makes this error less likely... and fixed it as if by magic when
    making the required changes.

 src/addressbook/e-book-backend-ews.c |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-ews.c b/src/addressbook/e-book-backend-ews.c
index 185743b..4490aec 100644
--- a/src/addressbook/e-book-backend-ews.c
+++ b/src/addressbook/e-book-backend-ews.c
@@ -3032,23 +3032,23 @@ e_book_backend_ews_get_backend_property (EBookBackend *backend,
 
                for (i = 0; i < G_N_ELEMENTS (mappings); i++)
                        if (mappings[i].element_type == ELEMENT_TYPE_SIMPLE)
-                               fields = g_slist_append (fields, g_strdup (e_contact_field_name 
(mappings[i].field_id)));
+                               fields = g_slist_append (fields, (gpointer) e_contact_field_name 
(mappings[i].field_id));
 
                for (i = 0; i < G_N_ELEMENTS (phone_field_map); i++)
-                       fields = g_slist_append (fields, g_strdup (e_contact_field_name 
(phone_field_map[i].field)));
-
-               fields = g_slist_append (fields, g_strdup (e_contact_field_name (E_CONTACT_FULL_NAME)));
-               fields = g_slist_append (fields, g_strdup (e_contact_field_name (E_CONTACT_NICKNAME)));
-               fields = g_slist_append (fields, g_strdup (e_contact_field_name (E_CONTACT_FAMILY_NAME)));
-               fields = g_slist_append (fields, g_strdup (e_contact_field_name (E_CONTACT_EMAIL_1)));
-               fields = g_slist_append (fields, g_strdup (e_contact_field_name (E_CONTACT_EMAIL_2)));
-               fields = g_slist_append (fields, g_strdup (e_contact_field_name (E_CONTACT_EMAIL_3)));
-               fields = g_slist_append (fields, g_strdup (e_contact_field_name (E_CONTACT_ADDRESS_WORK)));
-               fields = g_slist_append (fields, g_strdup (e_contact_field_name (E_CONTACT_ADDRESS_HOME)));
-               fields = g_slist_append (fields, g_strdup (e_contact_field_name (E_CONTACT_ADDRESS_OTHER)));
-               fields = g_slist_append (fields, g_strdup (e_contact_field_name (E_CONTACT_BIRTH_DATE)));
-
-               fields = g_slist_append (fields, g_strdup (e_contact_field_name (E_CONTACT_NOTE)));
+                       fields = g_slist_append (fields, (gpointer) e_contact_field_name 
(phone_field_map[i].field));
+
+               fields = g_slist_append (fields, (gpointer) e_contact_field_name (E_CONTACT_FULL_NAME));
+               fields = g_slist_append (fields, (gpointer) e_contact_field_name (E_CONTACT_NICKNAME));
+               fields = g_slist_append (fields, (gpointer) e_contact_field_name (E_CONTACT_FAMILY_NAME));
+               fields = g_slist_append (fields, (gpointer) e_contact_field_name (E_CONTACT_EMAIL_1));
+               fields = g_slist_append (fields, (gpointer) e_contact_field_name (E_CONTACT_EMAIL_2));
+               fields = g_slist_append (fields, (gpointer) e_contact_field_name (E_CONTACT_EMAIL_3));
+               fields = g_slist_append (fields, (gpointer) e_contact_field_name (E_CONTACT_ADDRESS_WORK));
+               fields = g_slist_append (fields, (gpointer) e_contact_field_name (E_CONTACT_ADDRESS_HOME));
+               fields = g_slist_append (fields, (gpointer) e_contact_field_name (E_CONTACT_ADDRESS_OTHER));
+               fields = g_slist_append (fields, (gpointer) e_contact_field_name (E_CONTACT_BIRTH_DATE));
+
+               fields = g_slist_append (fields, (gpointer) e_contact_field_name (E_CONTACT_NOTE));
 
                fields_str = e_data_book_string_slist_to_comma_string (fields);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]