[dovecot-cvs] dovecot/src/plugins/trash trash-plugin.c,1.2,1.3
cras at dovecot.org
cras at dovecot.org
Sat Jan 14 20:48:16 EET 2006
Update of /var/lib/cvs/dovecot/src/plugins/trash
In directory talvi:/tmp/cvs-serv16037/plugins/trash
Modified Files:
trash-plugin.c
Log Message:
deinit, unref, destroy, close, free, etc. functions now take a pointer to
their data pointer, and set it to NULL. This makes double-frees less likely
to cause security holes.
Index: trash-plugin.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/trash/trash-plugin.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- trash-plugin.c 13 Jan 2006 20:26:46 -0000 1.2
+++ trash-plugin.c 14 Jan 2006 18:48:14 -0000 1.3
@@ -146,23 +146,18 @@
for (i = 0; i < count; i++) {
struct trash_mailbox *trash = &trashes[i];
- mail_free(trash->mail);
- trash->mail = NULL;
-
- (void)mailbox_search_deinit(trash->search_ctx);
- trash->search_ctx = NULL;
+ mail_free(&trash->mail);
+ (void)mailbox_search_deinit(&trash->search_ctx);
if (size_needed == 0) {
- (void)mailbox_transaction_commit(trash->trans,
+ (void)mailbox_transaction_commit(&trash->trans,
MAILBOX_SYNC_FLAG_FULL_WRITE);
} else {
/* couldn't get enough space, don't expunge anything */
- mailbox_transaction_rollback(trash->trans);
+ mailbox_transaction_rollback(&trash->trans);
}
- trash->trans = NULL;
- mailbox_close(trash->box);
- trash->box = NULL;
+ mailbox_close(&trash->box);
}
return size_needed == 0;
}
@@ -265,7 +260,7 @@
trash->name = p_strdup(config_pool, name+1);
trash->priority = atoi(t_strdup_until(line, name));
}
- i_stream_unref(input);
+ i_stream_unref(&input);
(void)close(fd);
qsort(array_get_modifyable(&trash_boxes, NULL),
More information about the dovecot-cvs
mailing list