From: Timo Sirainen Date: Sat, 20 Sep 2008 16:30:07 +0000 (+0300) Subject: Don't use uninitialized variable for allocating initial array size. X-Git-Tag: 1.2.alpha2~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9dec31a2fc9034280cbe8d23857b2070b249a716;p=thirdparty%2Fdovecot%2Fcore.git Don't use uninitialized variable for allocating initial array size. --HG-- branch : HEAD --- diff --git a/src/lib-dict/dict-sql-settings.c b/src/lib-dict/dict-sql-settings.c index f071efce27..0abe922633 100644 --- a/src/lib-dict/dict-sql-settings.c +++ b/src/lib-dict/dict-sql-settings.c @@ -72,12 +72,12 @@ static const char *dict_sql_fields_map(struct setting_parser_ctx *ctx) 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);