[dovecot-cvs] dovecot/src/lib-dict dict-client.c, 1.4,
1.5 dict-sql.c, 1.4, 1.5 dict.c, 1.4, 1.5 dict.h, 1.4, 1.5
cras at dovecot.org
cras at dovecot.org
Sat Jan 14 20:47:30 EET 2006
- Previous message: [dovecot-cvs] dovecot/src/imap client.c, 1.62, 1.63 cmd-append.c,
1.70, 1.71 cmd-close.c, 1.16, 1.17 cmd-copy.c, 1.32,
1.33 cmd-delete.c, 1.10, 1.11 cmd-idle.c, 1.26,
1.27 cmd-list.c, 1.50, 1.51 cmd-logout.c, 1.10,
1.11 cmd-search.c, 1.27, 1.28 cmd-select.c, 1.39,
1.40 cmd-status.c, 1.25, 1.26 cmd-store.c, 1.34,
1.35 cmd-unselect.c, 1.7, 1.8 imap-expunge.c, 1.7,
1.8 imap-fetch-body.c, 1.26, 1.27 imap-fetch.c, 1.41,
1.42 imap-sort.c, 1.25, 1.26 imap-sync.c, 1.15,
1.16 imap-thread.c, 1.19, 1.20 main.c, 1.69, 1.70 namespace.c,
1.12, 1.13
- Next message: [dovecot-cvs] dovecot/src/lib buffer.c, 1.29, 1.30 buffer.h, 1.17,
1.18 file-cache.c, 1.10, 1.11 file-cache.h, 1.4, 1.5 hash.c,
1.23, 1.24 hash.h, 1.13, 1.14 ioloop-notify-dn.c, 1.12,
1.13 ioloop.c, 1.30, 1.31 ioloop.h, 1.15, 1.16 istream-limit.c,
1.17, 1.18 istream-seekable.c, 1.7, 1.8 istream.c, 1.32,
1.33 istream.h, 1.22, 1.23 lib-signals.c, 1.10,
1.11 module-dir.c, 1.11, 1.12 module-dir.h, 1.3,
1.4 ostream-crlf.c, 1.12, 1.13 ostream-file.c, 1.58,
1.59 ostream.c, 1.14, 1.15 ostream.h, 1.13, 1.14 str.c, 1.16,
1.17 str.h, 1.7, 1.8
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/cvs/dovecot/src/lib-dict
In directory talvi:/tmp/cvs-serv16037/lib-dict
Modified Files:
dict-client.c dict-sql.c dict.c dict.h
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: dict-client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-dict/dict-client.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- dict-client.c 13 Jan 2006 20:26:07 -0000 1.4
+++ dict-client.c 14 Jan 2006 18:47:27 -0000 1.5
@@ -208,14 +208,10 @@
dict->connect_counter++;
dict->handshaked = FALSE;
- if (dict->input != NULL) {
- i_stream_unref(dict->input);
- dict->input = NULL;
- }
- if (dict->output != NULL) {
- o_stream_unref(dict->output);
- dict->output = NULL;
- }
+ if (dict->input != NULL)
+ i_stream_unref(&dict->input);
+ if (dict->output != NULL)
+ o_stream_unref(&dict->output);
if (dict->fd != -1) {
if (close(dict->fd) < 0)
Index: dict-sql.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-dict/dict-sql.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- dict-sql.c 13 Jan 2006 20:26:07 -0000 1.4
+++ dict-sql.c 14 Jan 2006 18:47:27 -0000 1.5
@@ -69,7 +69,7 @@
t_pop();
}
- i_stream_unref(input);
+ i_stream_unref(&input);
(void)close(fd);
if (dict->connect_string == NULL) {
@@ -117,7 +117,7 @@
{
struct sql_dict *dict = (struct sql_dict *)_dict;
- sql_deinit(dict->db);
+ sql_deinit(&dict->db);
pool_unref(dict->pool);
}
@@ -217,7 +217,7 @@
const char *error;
int ret;
- ret = sql_transaction_commit_s(ctx->sql_ctx, &error);
+ ret = sql_transaction_commit_s(&ctx->sql_ctx, &error);
if (ret < 0)
i_error("sql dict: commit failed: %s", error);
i_free(ctx);
@@ -229,7 +229,7 @@
struct sql_dict_transaction_context *ctx =
(struct sql_dict_transaction_context *)_ctx;
- sql_transaction_rollback(ctx->sql_ctx);
+ sql_transaction_rollback(&ctx->sql_ctx);
i_free(ctx);
}
Index: dict.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-dict/dict.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- dict.c 13 Jan 2006 20:26:07 -0000 1.4
+++ dict.c 14 Jan 2006 18:47:27 -0000 1.5
@@ -71,8 +71,11 @@
return dict->v.init(dict, p+1);
}
-void dict_deinit(struct dict *dict)
+void dict_deinit(struct dict **_dict)
{
+ struct dict *dict = *_dict;
+
+ *_dict = NULL;
dict->v.deinit(dict);
}
Index: dict.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-dict/dict.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- dict.h 13 Jan 2006 20:26:07 -0000 1.4
+++ dict.h 14 Jan 2006 18:47:27 -0000 1.5
@@ -13,7 +13,7 @@
If URI is invalid, returns NULL. */
struct dict *dict_init(const char *uri);
/* Close dictionary. */
-void dict_deinit(struct dict *dict);
+void dict_deinit(struct dict **dict);
/* Lookup value for key. Set it to NULL if it's not found.
Returns 1 if found, 0 if not found and -1 if lookup failed. */
- Previous message: [dovecot-cvs] dovecot/src/imap client.c, 1.62, 1.63 cmd-append.c,
1.70, 1.71 cmd-close.c, 1.16, 1.17 cmd-copy.c, 1.32,
1.33 cmd-delete.c, 1.10, 1.11 cmd-idle.c, 1.26,
1.27 cmd-list.c, 1.50, 1.51 cmd-logout.c, 1.10,
1.11 cmd-search.c, 1.27, 1.28 cmd-select.c, 1.39,
1.40 cmd-status.c, 1.25, 1.26 cmd-store.c, 1.34,
1.35 cmd-unselect.c, 1.7, 1.8 imap-expunge.c, 1.7,
1.8 imap-fetch-body.c, 1.26, 1.27 imap-fetch.c, 1.41,
1.42 imap-sort.c, 1.25, 1.26 imap-sync.c, 1.15,
1.16 imap-thread.c, 1.19, 1.20 main.c, 1.69, 1.70 namespace.c,
1.12, 1.13
- Next message: [dovecot-cvs] dovecot/src/lib buffer.c, 1.29, 1.30 buffer.h, 1.17,
1.18 file-cache.c, 1.10, 1.11 file-cache.h, 1.4, 1.5 hash.c,
1.23, 1.24 hash.h, 1.13, 1.14 ioloop-notify-dn.c, 1.12,
1.13 ioloop.c, 1.30, 1.31 ioloop.h, 1.15, 1.16 istream-limit.c,
1.17, 1.18 istream-seekable.c, 1.7, 1.8 istream.c, 1.32,
1.33 istream.h, 1.22, 1.23 lib-signals.c, 1.10,
1.11 module-dir.c, 1.11, 1.12 module-dir.h, 1.3,
1.4 ostream-crlf.c, 1.12, 1.13 ostream-file.c, 1.58,
1.59 ostream.c, 1.14, 1.15 ostream.h, 1.13, 1.14 str.c, 1.16,
1.17 str.h, 1.7, 1.8
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list