]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Don't use uninitialized variable for allocating initial array size.
authorTimo Sirainen <tss@iki.fi>
Sat, 20 Sep 2008 16:30:07 +0000 (19:30 +0300)
committerTimo Sirainen <tss@iki.fi>
Sat, 20 Sep 2008 16:30:07 +0000 (19:30 +0300)
--HG--
branch : HEAD

src/lib-dict/dict-sql-settings.c

index f071efce27368296dd75522bc09e981631a8ead6..0abe92263390f9e11e0f07ced76e24beb090a561 100644 (file)
@@ -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);