[evolution-patches] leaky camel



The old code happily overwrites the previous array.

--Larry
? camel-mime-filter-enriched.c.new
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.1833
diff -u -p -r1.1833 ChangeLog
--- ChangeLog	18 Jun 2003 17:55:38 -0000	1.1833
+++ ChangeLog	19 Jun 2003 17:01:38 -0000
@@ -1,3 +1,8 @@
+2003-06-19  Larry Ewing  <lewing ximian com>
+
+	* camel-folder-summary.c (message_info_load): free the old
+	refernces array.
+
 2003-06-13  Jeffrey Stedfast  <fejj ximian com>
 
 	* providers/pop3/camel-pop3-folder.c (pop3_finalize): Made static
Index: camel-folder-summary.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-folder-summary.c,v
retrieving revision 1.121
diff -u -p -r1.121 camel-folder-summary.c
--- camel-folder-summary.c	18 Jun 2003 06:14:09 -0000	1.121
+++ camel-folder-summary.c	19 Jun 2003 17:01:39 -0000
@@ -1758,8 +1758,11 @@ message_info_load(CamelFolderSummary *s,
 		goto error;
 
 	if (count > 0) {
+		void *old = mi->references;
 		mi->references = g_malloc(sizeof(*mi->references) + ((count-1) * sizeof(mi->references->references[0])));
 		mi->references->size = count;
+		g_free (old);
+
 		for (i=0;i<count;i++) {
 			camel_file_util_decode_fixed_int32(in, &mi->references->references[i].id.part.hi);
 			camel_file_util_decode_fixed_int32(in, &mi->references->references[i].id.part.lo);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]