don't leak the string returned by cal_component_get_as_string nor the

2001-11-08  Rodrigo Moya <rodrigo@ximian.com>

	* pcs/cal-backend-file.c
	(cal_backend_file_compute_changes_foreach_key): don't leak the
	string returned by cal_component_get_as_string nor the temporary
	CalComponent we create

svn path=/trunk/; revision=14629
This commit is contained in:
Rodrigo Moya
2001-11-08 18:29:07 +00:00
committed by Rodrigo Moya
parent 12323a556d
commit 6a46f7cb26
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2001-11-08 Rodrigo Moya <rodrigo@ximian.com>
* pcs/cal-backend-file.c
(cal_backend_file_compute_changes_foreach_key): don't leak the
string returned by cal_component_get_as_string nor the temporary
CalComponent we create
2001-11-08 JP Rosevear <jpr@ximian.com>
* gui/e-itip-control.c (ok_clicked_cb): don't add the item, remove

View File

@ -1355,19 +1355,25 @@ cal_backend_file_compute_changes_foreach_key (const char *key, gpointer data)
if (calobj == NULL) {
CalComponent *comp;
GNOME_Evolution_Calendar_CalObjChange *coc;
char *calobj;
comp = cal_component_new ();
if (be_data->type == GNOME_Evolution_Calendar_TYPE_TODO)
cal_component_set_new_vtype (comp, CAL_COMPONENT_TODO);
else
cal_component_set_new_vtype (comp, CAL_COMPONENT_EVENT);
cal_component_set_uid (comp, key);
calobj = cal_component_get_as_string (comp);
coc = GNOME_Evolution_Calendar_CalObjChange__alloc ();
coc->calobj = CORBA_string_dup (cal_component_get_as_string (comp));
coc->calobj = CORBA_string_dup (calobj);
coc->type = GNOME_Evolution_Calendar_DELETED;
be_data->changes = g_list_prepend (be_data->changes, coc);
be_data->change_ids = g_list_prepend (be_data->change_ids, g_strdup (key));
g_free (calobj);
gtk_object_unref (GTK_OBJECT (comp));
}
}