Guys,

  Hey looking real good on the current svn HEAD (rev 2117). I belive I
found a few minor memleaks in the imap daemon. Attached is a patch.


Thanks,
Leif
diff -urNab dbmail-svn-2.1.6-2117.orig/dbmail-imapsession.c dbmail-svn-2.1.6-2117/dbmail-imapsession.c
--- dbmail-svn-2.1.6-2117.orig/dbmail-imapsession.c	2006-05-13 14:06:41.000000000 -0400
+++ dbmail-svn-2.1.6-2117/dbmail-imapsession.c	2006-05-13 14:43:29.000000000 -0400
@@ -1091,13 +1091,19 @@
 
         fd = self->ci->tx;
 
-        if (feof(fd) || fflush(fd) < 0)
+        if (feof(fd) || fflush(fd) < 0){
+        	g_free(re);
+		g_free(ln);
                 trace(TRACE_FATAL, "%s,%s: client socket closed", __FILE__, __func__);
+	}
 
         len = g_mime_stream_write_string(self->fstream,ln);
 	
-        if (len < 0)
+        if (len < 0) {
+       		g_free(re);
+		g_free(ln);
                 trace(TRACE_FATAL, "%s,%s: write to client socket failed", __FILE__, __func__);
+	}
 
         if (result < maxlen)
                 trace(TRACE_DEBUG,"RESPONSE: [%s]", re);
diff -urNab dbmail-svn-2.1.6-2117.orig/dbmail-message.c dbmail-svn-2.1.6-2117/dbmail-message.c
--- dbmail-svn-2.1.6-2117.orig/dbmail-message.c	2006-05-13 14:06:40.000000000 -0400
+++ dbmail-svn-2.1.6-2117/dbmail-message.c	2006-05-13 14:38:58.000000000 -0400
@@ -777,8 +777,11 @@
 	
 	/* insert a new physmessage entry */
 	internal_date = dbmail_message_get_internal_date(self);
-	if (db_insert_physmessage_with_internal_date(internal_date, &physmessage_id) == -1) 
+	if (db_insert_physmessage_with_internal_date(internal_date, &physmessage_id) == -1) {
+		g_free(internal_date);
 		return -1;
+	}
+	g_free(internal_date);
 
 	/* insert the physmessage-id into the message-headers */
 	g_snprintf(physid, 16, "%llu", physmessage_id);

Reply via email to