]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
matches[] wasn't also allocated enough memory.
authorTimo Sirainen <tss@iki.fi>
Sun, 30 Mar 2008 17:45:50 +0000 (20:45 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 30 Mar 2008 17:45:50 +0000 (20:45 +0300)
--HG--
branch : HEAD

src/lib/str-find.c

index 15f8f10c34d145b353cae9e383d49130e07de8cf..a37c0dabf6a7370a947d0d5d6bd787c1bd99159d 100644 (file)
@@ -82,7 +82,7 @@ struct str_find_context *str_find_init(pool_t pool, const char *key)
        ctx = p_malloc(pool, sizeof(struct str_find_context) +
                       sizeof(ctx->goodtab[0]) * key_len);
        ctx->pool = pool;
-       ctx->matches = p_malloc(pool, key_len);
+       ctx->matches = p_new(pool, unsigned int, key_len);
        ctx->key_len = key_len;
        ctx->key = p_malloc(pool, key_len);
        memcpy(ctx->key, key, key_len);