[dovecot-cvs] dovecot/src/lib-storage mail-storage.c,1.14,1.15 mail-storage.h,1.42,1.43

cras at procontrol.fi cras at procontrol.fi
Fri Apr 11 02:37:28 EEST 2003


Update of /home/cvs/dovecot/src/lib-storage
In directory danu:/tmp/cvs-serv25028/lib-storage

Modified Files:
	mail-storage.c mail-storage.h 
Log Message:
minor memory leak/cleanup fixes



Index: mail-storage.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/mail-storage.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- mail-storage.c	20 Feb 2003 16:41:16 -0000	1.14
+++ mail-storage.c	10 Apr 2003 22:37:25 -0000	1.15
@@ -59,6 +59,18 @@
 	}
 }
 
+void mail_storage_deinit(void)
+{
+	struct mail_storage_list *next;
+
+	while (storages != NULL) {
+		next = storages->next;
+
+		i_free(storages);
+                storages = next;
+	}
+}
+
 void mail_storage_class_register(struct mail_storage *storage_class)
 {
 	struct mail_storage_list *list, **pos;
@@ -160,8 +172,7 @@
 {
 	i_assert(storage != NULL);
 
-	i_free(storage->dir);
-	i_free(storage);
+	storage->free(storage);
 }
 
 void mail_storage_clear_error(struct mail_storage *storage)
@@ -212,6 +223,7 @@
 
 	tm = localtime(&ioloop_time);
 
+	i_free(storage->error);
 	storage->error = strftime(str, sizeof(str), CRITICAL_MSG, tm) > 0 ?
 		i_strdup(str) : i_strdup("Internal error");
 	storage->syntax_error = FALSE;

Index: mail-storage.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/mail-storage.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- mail-storage.h	9 Mar 2003 09:56:05 -0000	1.42
+++ mail-storage.h	10 Apr 2003 22:37:25 -0000	1.43
@@ -428,8 +428,8 @@
 extern enum client_workarounds client_workarounds;
 extern int full_filesystem_access;
 
-/* Initialize mail storage. */
 void mail_storage_init(void);
+void mail_storage_deinit(void);
 
 /* register all mail storages */
 void mail_storage_register_all(void);




More information about the dovecot-cvs mailing list