From: Timo Sirainen Date: Fri, 29 Apr 2016 09:34:23 +0000 (+0300) Subject: lib-index: Memory allocation optimization X-Git-Tag: 2.3.0.rc1~3916 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f7ef214d77493f0063c494f3595d46cb165eae87;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Memory allocation optimization --- diff --git a/src/lib-index/mail-index-map.c b/src/lib-index/mail-index-map.c index de422cbabf..52f9ad02ab 100644 --- a/src/lib-index/mail-index-map.c +++ b/src/lib-index/mail-index-map.c @@ -327,7 +327,7 @@ static void mail_index_map_copy_records(struct mail_index_record_map *dest, size_t size; size = src->records_count * record_size; - dest->buffer = buffer_create_dynamic(default_pool, I_MIN(size, 1024)); + dest->buffer = buffer_create_dynamic(default_pool, I_MAX(size, 1024)); buffer_append(dest->buffer, src->records, size); dest->records = buffer_get_modifiable_data(dest->buffer, NULL);