[dovecot-cvs] dovecot/src/lib-storage/index/dbox dbox-sync-expunge.c, 1.18, 1.19 dbox-uidlist.c, 1.36, 1.37
cras at dovecot.org
cras at dovecot.org
Sun Jul 23 22:09:02 EEST 2006
Update of /var/lib/cvs/dovecot/src/lib-storage/index/dbox
In directory talvi:/tmp/cvs-serv18542
Modified Files:
dbox-sync-expunge.c dbox-uidlist.c
Log Message:
Memory/fd leak fixes
Index: dbox-sync-expunge.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/dbox/dbox-sync-expunge.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- dbox-sync-expunge.c 23 Jul 2006 14:20:30 -0000 1.18
+++ dbox-sync-expunge.c 23 Jul 2006 19:08:58 -0000 1.19
@@ -153,12 +153,12 @@
dest_entry.file_seq = file_seq;
/* write file header */
- t_push();
- file = t_new(struct dbox_file, 1);
+ file = i_new(struct dbox_file, 1);
+ file->fd = -1;
file->output = output;
- if (dbox_file_write_header(mbox, file) < 0) // FIXME: leaks
+ if (dbox_file_write_header(mbox, file) < 0)
ret = -1;
- t_pop();
+ dbox_file_close(file);
while (ret > 0) {
/* update mail's location in index */
Index: dbox-uidlist.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/dbox/dbox-uidlist.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- dbox-uidlist.c 23 Jul 2006 19:01:03 -0000 1.36
+++ dbox-uidlist.c 23 Jul 2006 19:08:58 -0000 1.37
@@ -877,8 +877,10 @@
/* unlock files */
files = array_get(&ctx->files, &count);
- for (i = 0; i < count; i++)
+ for (i = 0; i < count; i++) {
file_dotlock_delete(&files[i]->dotlock);
+ dbox_file_close(files[i]->file);
+ }
if (ctx->locked)
dbox_uidlist_unlock(ctx->uidlist);
More information about the dovecot-cvs
mailing list