aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-09-10 18:00:06 +0800
committerMilan Crha <mcrha@redhat.com>2010-09-10 18:00:06 +0800
commita96676f44616b7d4debe98efdeee2c6f2be1d033 (patch)
tree48b625050778117095280b006878e5ec0d5aa422 /plugins
parentd09d5bcc9aee79b44d7842c7364d536b189a4ab3 (diff)
downloadgsoc2013-evolution-a96676f44616b7d4debe98efdeee2c6f2be1d033.tar
gsoc2013-evolution-a96676f44616b7d4debe98efdeee2c6f2be1d033.tar.gz
gsoc2013-evolution-a96676f44616b7d4debe98efdeee2c6f2be1d033.tar.bz2
gsoc2013-evolution-a96676f44616b7d4debe98efdeee2c6f2be1d033.tar.lz
gsoc2013-evolution-a96676f44616b7d4debe98efdeee2c6f2be1d033.tar.xz
gsoc2013-evolution-a96676f44616b7d4debe98efdeee2c6f2be1d033.tar.zst
gsoc2013-evolution-a96676f44616b7d4debe98efdeee2c6f2be1d033.zip
Bug #626579 - [bbdb] Crash in free_gaim_body() (gaimbuddies.c)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/bbdb/gaimbuddies.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/plugins/bbdb/gaimbuddies.c b/plugins/bbdb/gaimbuddies.c
index 66f77bcc99..df5e4c3695 100644
--- a/plugins/bbdb/gaimbuddies.c
+++ b/plugins/bbdb/gaimbuddies.c
@@ -345,7 +345,7 @@ static gboolean
bbdb_merge_buddy_to_contact (EBook *book, GaimBuddy *b, EContact *c)
{
EContactField field;
- GList *ims, *l;
+ GList *ims;
gboolean dirty = FALSE;
EContactPhoto *photo = NULL;
@@ -356,11 +356,15 @@ bbdb_merge_buddy_to_contact (EBook *book, GaimBuddy *b, EContact *c)
field = proto_to_contact_field (b->proto);
ims = e_contact_get (c, field);
if (!im_list_contains_buddy (ims, b)) {
- ims = g_list_append (ims, (gpointer) b->account_name);
+ ims = g_list_append (ims, g_strdup (b->account_name));
e_contact_set (c, field, (gpointer) ims);
dirty = TRUE;
}
+ g_list_foreach (ims, (GFunc) g_free, NULL);
+ g_list_free (ims);
+ ims = NULL;
+
/* Set the photo if it's not set */
if (b->icon != NULL) {
photo = e_contact_get (c, E_CONTACT_PHOTO);
@@ -375,9 +379,6 @@ bbdb_merge_buddy_to_contact (EBook *book, GaimBuddy *b, EContact *c)
&photo->data.inlined.length, &error)) {
g_warning ("bbdb: Could not read buddy icon: %s\n", error->message);
g_error_free (error);
- for (l = ims; l != NULL; l = l->next)
- g_free ((gchar *) l->data);
- g_list_free (ims);
return dirty;
}
@@ -391,10 +392,6 @@ bbdb_merge_buddy_to_contact (EBook *book, GaimBuddy *b, EContact *c)
if (photo != NULL)
e_contact_photo_free (photo);
- for (l = ims; l != NULL; l = l->next)
- g_free ((gchar *) l->data);
- g_list_free (ims);
-
return dirty;
}