dovecot-1.2: Don't use uninitialized variable for allocating ini...

dovecot at dovecot.org dovecot at dovecot.org
Sat Sep 20 19:30:12 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.2/rev/f643f8c0e29d
changeset: 8204:f643f8c0e29d
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Sep 20 19:30:07 2008 +0300
description:
Don't use uninitialized variable for allocating initial array size.

diffstat:

1 file changed, 2 insertions(+), 2 deletions(-)
src/lib-dict/dict-sql-settings.c |    4 ++--

diffs (18 lines):

diff -r fb0691b3de71 -r f643f8c0e29d src/lib-dict/dict-sql-settings.c
--- a/src/lib-dict/dict-sql-settings.c	Sat Sep 20 19:28:18 2008 +0300
+++ b/src/lib-dict/dict-sql-settings.c	Sat Sep 20 19:30:07 2008 +0300
@@ -72,12 +72,12 @@ static const char *dict_sql_fields_map(s
 	const char *p, *name;
 	unsigned int i, count;
 
-	p_array_init(&ctx->cur_map.sql_fields, ctx->pool, count);
-
 	/* go through the variables in the pattern, replace them with plain
 	   '$' character and add its sql field */
 	pattern = t_str_new(strlen(ctx->cur_map.pattern) + 1);
 	fields = array_get_modifiable(&ctx->cur_fields, &count);
+
+	p_array_init(&ctx->cur_map.sql_fields, ctx->pool, count);
 	for (p = ctx->cur_map.pattern; *p != '\0';) {
 		if (*p != '$') {
 			str_append_c(pattern, *p);


More information about the dovecot-cvs mailing list