rpms/evolution/devel gb-309138-attach-48417-fix-evo-conduit-memleaks.patch, NONE, 1.1 rh-161817-attach-116019-conduit_pilot_link_updates.diff, NONE, 1.1 evolution.spec, 1.73, 1.74

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Jun 27 22:58:50 UTC 2005


Author: dmalcolm

Update of /cvs/dist/rpms/evolution/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv24974

Modified Files:
	evolution.spec 
Added Files:
	gb-309138-attach-48417-fix-evo-conduit-memleaks.patch 
	rh-161817-attach-116019-conduit_pilot_link_updates.diff 
Log Message:
* Mon Jun 27 2005 David Malcolm <dmalcolm at redhat.com> - 2.2.2-9.fc5
- Replaced patch to port conduits to pilot-link-0.12 with Mark G Adams's version of same (#161817)
- Added Mark G Adams's memory leak fix (patch 801)



gb-309138-attach-48417-fix-evo-conduit-memleaks.patch:
 calendar/calendar-conduit.c |    2 ++
 todo/todo-conduit.c         |    1 +
 2 files changed, 3 insertions(+)

--- NEW FILE gb-309138-attach-48417-fix-evo-conduit-memleaks.patch ---
--- calendar/conduits/todo/todo-conduit.c~	2004-08-25 22:12:07.000000000 -0400
+++ calendar/conduits/todo/todo-conduit.c	2005-06-27 11:07:03.000000000 -0400
@@ -1191,6 +1191,7 @@
 	e_pilot_map_insert (ctxt->map, remote->ID, uid, FALSE);
 
 	g_object_unref (comp);
+	g_free (uid);
 
 	return retval;
 }
--- calendar/conduits/calendar/calendar-conduit.c~	2005-01-10 19:06:49.000000000 -0500
+++ calendar/conduits/calendar/calendar-conduit.c	2005-06-27 11:07:55.000000000 -0400
@@ -646,6 +646,8 @@
 
 		event_start = day_end;
 		day_end = time_day_end_with_zone (event_start, ctxt->timezone);
+
+		g_free (new_uid);
 	}
 	dt_start.value = old_start_value;
 	dt_end.value = old_end_value;

rh-161817-attach-116019-conduit_pilot_link_updates.diff:
 addressbook/conduit/address-conduit.c         |   48 +++++++++++++++++-------
 calendar/conduits/calendar/calendar-conduit.c |   51 ++++++++++++++++++--------
 calendar/conduits/todo/todo-conduit.c         |   45 ++++++++++++++++------
 3 files changed, 105 insertions(+), 39 deletions(-)

--- NEW FILE rh-161817-attach-116019-conduit_pilot_link_updates.diff ---
--- addressbook/conduit/address-conduit.c~	2005-06-27 11:37:21.000000000 -0400
+++ addressbook/conduit/address-conduit.c	2005-06-27 11:39:44.000000000 -0400
@@ -460,14 +460,19 @@
 {
 	static char buff[ 4096 ];
 	struct Address addr;
+	pi_buffer_t piBuf;
 
 	if (remote == NULL) {
 		sprintf (buff, "[NULL]");
 		return buff;
 	}
 
+	piBuf.data = remote->record;
+	piBuf.allocated = remote->length;
+	piBuf.used = remote->length;
+
 	memset (&addr, 0, sizeof (struct Address));
-	unpack_Address (&addr, remote->record, remote->length);
+	unpack_Address (&addr, &piBuf, address_v1);
 
 	g_snprintf (buff, 4096, "['%s' '%s' '%s']",
 		    addr.entry[entryLastname] ?
@@ -789,7 +794,8 @@
 			      EAddrConduitContext *ctxt)
 {
 	GnomePilotRecord p;
-	static char record[0xffff];
+	static unsigned char record[0xffff];
+	pi_buffer_t piBuf;
 	
 	g_assert (local->addr != NULL );
 	
@@ -801,9 +807,17 @@
 	p.archived = local->local.archived;
 	p.secret = local->local.secret;
 
+	memset (&piBuf, 0, sizeof (piBuf));
+	memset (record, 0, sizeof (record));
+	pack_Address (local->addr, &piBuf, address_v1);
+
 	/* Generate pilot record structure */
+	if (piBuf.used > 0)
+		memcpy (record, piBuf.data, piBuf.used);
 	p.record = record;
-	p.length = pack_Address (local->addr, p.record, 0xffff);
+	p.length = piBuf.used;
+	if (piBuf.data)
+		free (piBuf.data);
 
 	return p;	
 }
@@ -832,16 +846,16 @@
 	 */
 	if (local->local.ID != 0) {
 		struct Address addr;
-		char record[0xffff];
+		pi_buffer_t *buffer = pi_buffer_new (0xffff);
 		int cat = 0;
 		
 		if (dlp_ReadRecordById (ctxt->dbi->pilot_socket, 
 					ctxt->dbi->db_handle,
-					local->local.ID, &record, 
-					NULL, NULL, NULL, &cat) > 0) {
+					local->local.ID, buffer, 
+					NULL, NULL, &cat) > 0) {
 			local->local.category = cat;
 			memset (&addr, 0, sizeof (struct Address));
-			unpack_Address (&addr, record, 0xffff);
+			unpack_Address (&addr, buffer, address_v1);
 			for (i = 0; i < 5; i++) {
 				if (addr.entry[entryPhone1 + i])
 					local->addr->entry[entryPhone1 + i] = 
@@ -856,6 +870,8 @@
 			}
 			free_Address (&addr);
 		}
+
+		pi_buffer_free (buffer);
 	}
 
 	local->addr->entry[entryFirstname] = e_pilot_utf8_to_pchar (e_contact_get_const (contact, E_CONTACT_GIVEN_NAME));
@@ -1012,10 +1028,16 @@
 	EContactField next_mail, next_home, next_work, next_fax;
 	EContactField next_other, next_main, next_pager, next_mobile;
 	int i;
+	pi_buffer_t piBuf;
 
 	g_return_val_if_fail(remote!=NULL,NULL);
 	memset (&address, 0, sizeof (struct Address));
-	unpack_Address (&address, remote->record, remote->length);
+
+	piBuf.data = remote->record;
+	piBuf.allocated = remote->length;
+	piBuf.used = remote->length;
+
+	unpack_Address (&address, &piBuf, address_v1);
 
 	if (in_contact == NULL)
 		contact = e_contact_new ();
@@ -1161,7 +1183,7 @@
 	EBookQuery *query;
     	GList *l;
 	int len;
-	unsigned char *buf;
+	pi_buffer_t *buffer;
 	char *filename;
 	char *change_id;
 	gint num_records, add_records = 0, mod_records = 0, del_records = 0;
@@ -1244,9 +1266,9 @@
   	gnome_pilot_conduit_sync_abs_set_num_updated_local_records (abs_conduit, mod_records);
   	gnome_pilot_conduit_sync_abs_set_num_deleted_local_records(abs_conduit, del_records);
 
-	buf = (unsigned char*)g_malloc (0xffff);
+	buffer = pi_buffer_new (0xffff);
 	len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
-			      (unsigned char *)buf, 0xffff);
+				-1, buffer);
 	
 	if (len < 0) {
 		WARN (_("Could not read pilot's Address application block"));
@@ -1255,8 +1277,8 @@
 					   _("Could not read pilot's Address application block"));
 		return -1;
 	}
-	unpack_AddressAppInfo (&(ctxt->ai), buf, len);
-	g_free (buf);
+	unpack_AddressAppInfo (&(ctxt->ai), buffer->data, len);
+	pi_buffer_free (buffer);
 
   	check_for_slow_setting (conduit, ctxt);
 	if (ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyToPilot
--- calendar/conduits/calendar/calendar-conduit.c~	2005-06-27 11:43:23.000000000 -0400
+++ calendar/conduits/calendar/calendar-conduit.c	2005-06-27 11:43:33.000000000 -0400
@@ -404,14 +404,20 @@
 {
 	static char buff[ 4096 ];
 	struct Appointment appt;
+	pi_buffer_t piBuf;
 
 	if (remote == NULL) {
 		sprintf (buff, "[NULL]");
 		return buff;
 	}
 
+
+	piBuf.data = remote->record;
+	piBuf.allocated = remote->length;
+	piBuf.used = remote->length;
+
 	memset (&appt, 0, sizeof (struct Appointment));
-	unpack_Appointment (&appt, remote->record, remote->length);
+	unpack_Appointment (&appt, &piBuf, datebook_v1);
 
 	g_snprintf (buff, 4096, "[%ld %ld '%s' '%s']",
 		    mktime (&appt.begin),
@@ -753,7 +759,8 @@
 			      ECalConduitContext *ctxt)
 {
 	GnomePilotRecord p;
-	static char record[0xffff];
+	static unsigned char record[0xffff];
+	pi_buffer_t piBuf;
 
 	g_assert (local->comp != NULL);
 	g_assert (local->appt != NULL );
@@ -764,9 +771,17 @@
 	p.archived = local->local.archived;
 	p.secret = local->local.secret;
 
+	memset (&piBuf, 0, sizeof (piBuf));
+	memset (record, 0, sizeof (record));
+	pack_Appointment (local->appt, &piBuf, datebook_v1);
+
 	/* Generate pilot record structure */
+	if (piBuf.used > 0)
+		memcpy (record, piBuf.data, piBuf.used);
 	p.record = record;
-	p.length = pack_Appointment (local->appt, p.record, 0xffff);
+	p.length = piBuf.used;
+	if (piBuf.data)
+		free (piBuf.data);
 
 	return p;	
 }
@@ -802,22 +817,24 @@
          * we don't overwrite them 
 	 */
 	if (local->local.ID != 0) {
-		struct Appointment appt;		
-		char record[0xffff];
+		struct Appointment appt;
+		pi_buffer_t *buffer = pi_buffer_new (0xffff);
 		int cat = 0;
 		
 		if (dlp_ReadRecordById (ctxt->dbi->pilot_socket, 
 					ctxt->dbi->db_handle,
-					local->local.ID, &record, 
-					NULL, NULL, NULL, &cat) > 0) {
+					local->local.ID, buffer,
+					NULL, NULL, &cat) > 0) {
 			local->local.category = cat;
 			memset (&appt, 0, sizeof (struct Appointment));
-			unpack_Appointment (&appt, record, 0xffff);
+			unpack_Appointment (&appt, buffer, datebook_v1);
 			local->appt->alarm = appt.alarm;
 			local->appt->advance = appt.advance;
 			local->appt->advanceUnits = appt.advanceUnits;
 			free_Appointment (&appt);
 		}
+
+		pi_buffer_free (buffer);
 	}
 
 	/* STOP: don't replace these with g_strdup, since free_Appointment
@@ -1075,11 +1092,17 @@
 	GSList *edl = NULL;	
 	char *txt;
 	int pos, i;
+	pi_buffer_t piBuf;
 	
 	g_return_val_if_fail (remote != NULL, NULL);
 
+
+	piBuf.data = remote->record;
+	piBuf.allocated = remote->length;
+	piBuf.used = remote->length;
+
 	memset (&appt, 0, sizeof (struct Appointment));
-	unpack_Appointment (&appt, remote->record, remote->length);
+	unpack_Appointment (&appt, &piBuf, datebook_v1);
 
 	if (in_comp == NULL) {
 		comp = e_cal_component_new ();
@@ -1344,7 +1367,7 @@
 	GnomePilotConduitSyncAbs *abs_conduit;
 	GList *removed = NULL, *added = NULL, *l;
 	int len;
-	unsigned char *buf;
+	pi_buffer_t *buffer;
 	char *filename, *change_id;
 	icalcomponent *icalcomp;
 	gint num_records, add_records = 0, mod_records = 0, del_records = 0;
@@ -1462,9 +1485,9 @@
 	gnome_pilot_conduit_sync_abs_set_num_updated_local_records (abs_conduit, mod_records);
 	gnome_pilot_conduit_sync_abs_set_num_deleted_local_records(abs_conduit, del_records);
 
-	buf = (unsigned char*)g_malloc (0xffff);
+	buffer = pi_buffer_new (0xffff);
 	len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
-			      (unsigned char *)buf, 0xffff);
+				-1, buffer);
 	
 	if (len < 0) {
 		WARN (_("Could not read pilot's Calendar application block"));
@@ -1473,8 +1496,8 @@
 					   _("Could not read pilot's Calendar application block"));
 		return -1;
 	}
-	unpack_AppointmentAppInfo (&(ctxt->ai), buf, len);
-	g_free (buf);
+	unpack_AppointmentAppInfo (&(ctxt->ai), buffer->data, len);
+	pi_buffer_free (buffer);
 
 	check_for_slow_setting (conduit, ctxt);
 	if (ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyToPilot
--- calendar/conduits/todo/todo-conduit.c~	2005-06-27 11:43:18.000000000 -0400
+++ calendar/conduits/todo/todo-conduit.c	2005-06-27 11:43:40.000000000 -0400
@@ -396,14 +396,19 @@
 {
 	static char buff[ 4096 ];
 	struct ToDo todo;
+	pi_buffer_t piBuf;
 
 	if (remote == NULL) {
 		sprintf (buff, "[NULL]");
 		return buff;
 	}
 
+	piBuf.data = remote->record;
+	piBuf.allocated = remote->length;
+	piBuf.used = remote->length;
+
 	memset (&todo, 0, sizeof (struct ToDo));
-	unpack_ToDo (&todo, remote->record, remote->length);
+	unpack_ToDo (&todo, &piBuf, todo_v1);
 
 	g_snprintf (buff, 4096, "[%d %ld %d %d '%s' '%s']",
 		    todo.indefinite,
@@ -545,7 +550,8 @@
 			      EToDoConduitContext *ctxt)
 {
 	GnomePilotRecord p;
-	static char record[0xffff];
+	static unsigned char record[0xffff];
+	pi_buffer_t piBuf;
 
 	g_assert (local->comp != NULL);
 	g_assert (local->todo != NULL );
@@ -558,9 +564,17 @@
 	p.archived = local->local.archived;
 	p.secret = local->local.secret;
 
+	memset (&piBuf, 0, sizeof (piBuf));
+	memset (record, 0, sizeof (record));
+	pack_ToDo (local->todo, &piBuf, todo_v1);
+
 	/* Generate pilot record structure */
+	if (piBuf.used > 0)
+		memcpy (record, piBuf.data, piBuf.used);
 	p.record = record;
-	p.length = pack_ToDo (local->todo, p.record, 0xffff);
+	p.length = piBuf.used;
+	if (piBuf.data)
+		free (piBuf.data);
 
 	return p;	
 }
@@ -598,15 +612,17 @@
 
 	/* Don't overwrite the category */
 	if (local->local.ID != 0) {
-		char record[0xffff];
+		pi_buffer_t *buffer = pi_buffer_new (0xffff);
 		int cat = 0;
 		
 		if (dlp_ReadRecordById (ctxt->dbi->pilot_socket, 
 					ctxt->dbi->db_handle,
-					local->local.ID, &record, 
-					NULL, NULL, NULL, &cat) > 0) {
+					local->local.ID, buffer, 
+					NULL, NULL, &cat) > 0) {
 			local->local.category = cat;			
 		}
+
+		pi_buffer_free (buffer);
 	}
 
 	/* STOP: don't replace these with g_strdup, since free_ToDo
@@ -721,11 +737,16 @@
 	icaltimezone *utc_zone;
 	int priority;
 	char *txt;
+	pi_buffer_t piBuf;
 	
 	g_return_val_if_fail (remote != NULL, NULL);
 
+	piBuf.data = remote->record;
+	piBuf.allocated = remote->length;
+	piBuf.used = remote->length;
+
 	memset (&todo, 0, sizeof (struct ToDo));
-	unpack_ToDo (&todo, remote->record, remote->length);
+	unpack_ToDo (&todo, &piBuf, todo_v1);
 
 	utc_zone = icaltimezone_get_utc_timezone ();
 	now = icaltime_from_timet_with_zone (time (NULL), FALSE, 
@@ -861,7 +882,7 @@
 	GnomePilotConduitSyncAbs *abs_conduit;
 	GList *l;
 	int len;
-	unsigned char *buf;
+	pi_buffer_t *buffer;
 	char *filename, *change_id;
 	icalcomponent *icalcomp;
 	gint num_records, add_records = 0, mod_records = 0, del_records = 0;
@@ -951,9 +972,9 @@
 	gnome_pilot_conduit_sync_abs_set_num_updated_local_records (abs_conduit, mod_records);
 	gnome_pilot_conduit_sync_abs_set_num_deleted_local_records(abs_conduit, del_records);
 
-	buf = (unsigned char*)g_malloc (0xffff);
+	buffer = pi_buffer_new (0xffff);
 	len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
-			      (unsigned char *)buf, 0xffff);
+				-1, buffer);
 	
 	if (len < 0) {
 		WARN (_("Could not read pilot's ToDo application block"));
@@ -962,8 +983,8 @@
 					   _("Could not read pilot's ToDo application block"));
 		return -1;
 	}
-	unpack_ToDoAppInfo (&(ctxt->ai), buf, len);
-	g_free (buf);
+	unpack_ToDoAppInfo (&(ctxt->ai), buffer->data, len);
+	pi_buffer_free (buffer);
 
 	check_for_slow_setting (conduit, ctxt);
 	if (ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyToPilot


Index: evolution.spec
===================================================================
RCS file: /cvs/dist/rpms/evolution/devel/evolution.spec,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- evolution.spec	6 Jun 2005 23:22:15 -0000	1.73
+++ evolution.spec	27 Jun 2005 22:58:47 -0000	1.74
@@ -28,7 +28,7 @@
 
 Name: evolution
 Version: 2.2.2
-Release: 8
+Release: 9.fc5
 License: GPL
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 URL: http://www.ximian.com/
@@ -48,7 +48,7 @@
 Patch100: evo-addressbook-print-with-pango-2.patch
 Patch101: evo-calendar-print-with-pango-4.patch
 
-Patch104: evolution-2.2.0-port-to-pilot-link-0.12.patch
+#Patch104: evolution-2.2.0-port-to-pilot-link-0.12.patch
 
 Patch105: evolution-2.2.2-fix-new-mail-notify.patch
 
@@ -69,6 +69,10 @@
 # This was added upstream in 1.5.93, with configure-time detection
 #Patch700: evolution-1.5.9.1-filechooser.patch
 
+# Patches for conduits by Mark G. Adams:
+Patch800: rh-161817-attach-116019-conduit_pilot_link_updates.diff
+Patch801: gb-309138-attach-48417-fix-evo-conduit-memleaks.patch
+
 Summary: GNOME's next-generation groupware suite
 Group: Applications/Productivity
 
@@ -173,7 +177,6 @@
 %patch100 -p0 -b .addressbook-print-with-pango
 %patch101 -p1 -b .calendar-print-with-pango
 
-%patch104 -p1 -b .port-to-pilot-link-0.12
 %patch105 -p1 -b .fix-new-mail-notify
 %patch106 -p1 -b .commit-enter-on-calendar
 %patch107 -p1 -b .move-autosave-file
@@ -184,6 +187,9 @@
 
 #patch700 -p1 -b .filechooser
 
+%patch800 -p0 -b .fix-conduits
+%patch801 -p0 -b .fix-evo-conduit-memleaks
+
 mkdir -p krb5-fakeprefix/include
 mkdir -p krb5-fakeprefix/lib
 mkdir -p krb5-fakeprefix/%{_lib}
@@ -342,6 +348,10 @@
 %{_libdir}/evolution/%{evo_major}/*.so
 
 %changelog
+* Mon Jun 27 2005 David Malcolm <dmalcolm at redhat.com> - 2.2.2-9.fc5
+- Replaced patch to port conduits to pilot-link-0.12 with Mark G Adams's version of same (#161817)
+- Added Mark G Adams's memory leak fix (patch 801)
+
 * Mon Jun  6 2005 David Malcolm <dmalcolm at redhat.com> - 2.2.2-8
 - Added Ivan Gyurdiev's patch to move autosave files inside the .evolution
   directory




More information about the fedora-cvs-commits mailing list