From 68a1ba71154f3e443a2efa309a70409df1927f13 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Mon, 1 Oct 2001 18:24:31 +0000 Subject: strdup the uid to avoid double free, write out only after everything is 2001-10-01 JP Rosevear * pcs/cal-backend-file.c (cal_backend_file_compute_changes): strdup the uid to avoid double free, write out only after everything is done svn path=/trunk/; revision=13266 --- calendar/pcs/cal-backend-file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'calendar/pcs') diff --git a/calendar/pcs/cal-backend-file.c b/calendar/pcs/cal-backend-file.c index 0cc7c89f3e..3f0c73dc99 100644 --- a/calendar/pcs/cal-backend-file.c +++ b/calendar/pcs/cal-backend-file.c @@ -1436,14 +1436,14 @@ cal_backend_file_compute_changes (CalBackend *backend, CalObjType type, const ch coc->calobj = CORBA_string_dup (calobj); coc->type = GNOME_Evolution_Calendar_ADDED; changes = g_list_prepend (changes, coc); - change_ids = g_list_prepend (change_ids, uid); + change_ids = g_list_prepend (change_ids, g_strdup (uid)); break; case E_DBHASH_STATUS_DIFFERENT: coc = GNOME_Evolution_Calendar_CalObjChange__alloc (); coc->calobj = CORBA_string_dup (calobj); coc->type = GNOME_Evolution_Calendar_MODIFIED; changes = g_list_prepend (changes, coc); - change_ids = g_list_prepend (change_ids, uid); + change_ids = g_list_prepend (change_ids, g_strdup (uid)); break; } } @@ -1482,11 +1482,11 @@ cal_backend_file_compute_changes (CalBackend *backend, CalObjType type, const ch } else { e_dbhash_remove (ehash, uid); } - e_dbhash_write (ehash); CORBA_free (coc); g_free (uid); } + e_dbhash_write (ehash); e_dbhash_destroy (ehash); cal_obj_uid_list_free (uids); -- cgit