From: Timo Sirainen Date: Sun, 7 Sep 2003 14:10:50 +0000 (+0300) Subject: Fixed memory leak after compressing cache file. X-Git-Tag: 1.1.alpha1~4350 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c841f2879f7870540c231a12eebfb5f6425219c;p=thirdparty%2Fdovecot%2Fcore.git Fixed memory leak after compressing cache file. --HG-- branch : HEAD --- diff --git a/src/lib-index/mail-cache.c b/src/lib-index/mail-cache.c index a8c069d383..015f7c4b6c 100644 --- a/src/lib-index/mail-cache.c +++ b/src/lib-index/mail-cache.c @@ -688,6 +688,9 @@ static int mail_cache_copy(struct mail_cache *cache, int fd) if (msync(mmap_base, offset, MS_SYNC) < 0) return mail_cache_set_syscall_error(cache, "msync()"); + if (munmap(mmap_base, new_file_size) < 0) + return mail_cache_set_syscall_error(cache, "munmap()"); + if (fdatasync(fd) < 0) return mail_cache_set_syscall_error(cache, "fdatasync()"); return TRUE;