From: Timo Sirainen Date: Sun, 30 Mar 2008 17:45:50 +0000 (+0300) Subject: matches[] wasn't also allocated enough memory. X-Git-Tag: 1.1.rc4~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f609bd50846f898583ef481d8aac927b10aa8395;p=thirdparty%2Fdovecot%2Fcore.git matches[] wasn't also allocated enough memory. --HG-- branch : HEAD --- diff --git a/src/lib/str-find.c b/src/lib/str-find.c index 15f8f10c34..a37c0dabf6 100644 --- a/src/lib/str-find.c +++ b/src/lib/str-find.c @@ -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);