aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2001-11-09 02:29:07 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2001-11-09 02:29:07 +0800
commit6a46f7cb269ea39a2c8fe97c0be44a9699f4976a (patch)
tree283f5548953705ab93a0b8458859a081c10f4da7
parent12323a556d88c4e49cd80524f1e6cb29e9f54d1e (diff)
downloadgsoc2013-evolution-6a46f7cb269ea39a2c8fe97c0be44a9699f4976a.tar
gsoc2013-evolution-6a46f7cb269ea39a2c8fe97c0be44a9699f4976a.tar.gz
gsoc2013-evolution-6a46f7cb269ea39a2c8fe97c0be44a9699f4976a.tar.bz2
gsoc2013-evolution-6a46f7cb269ea39a2c8fe97c0be44a9699f4976a.tar.lz
gsoc2013-evolution-6a46f7cb269ea39a2c8fe97c0be44a9699f4976a.tar.xz
gsoc2013-evolution-6a46f7cb269ea39a2c8fe97c0be44a9699f4976a.tar.zst
gsoc2013-evolution-6a46f7cb269ea39a2c8fe97c0be44a9699f4976a.zip
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
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/pcs/cal-backend-file.c8
2 files changed, 14 insertions, 1 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index f78df1435f..b8c1b4b28e 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -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
diff --git a/calendar/pcs/cal-backend-file.c b/calendar/pcs/cal-backend-file.c
index de37203592..f1480a4b1d 100644
--- a/calendar/pcs/cal-backend-file.c
+++ b/calendar/pcs/cal-backend-file.c
@@ -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));
}
}