]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Fixed memory leak after compressing cache file.
authorTimo Sirainen <tss@iki.fi>
Sun, 7 Sep 2003 14:10:50 +0000 (17:10 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 7 Sep 2003 14:10:50 +0000 (17:10 +0300)
--HG--
branch : HEAD

src/lib-index/mail-cache.c

index a8c069d383ab0c5974b63f681780c3e84a6eabcf..015f7c4b6c2a5bacdca5728dda10c39d45290838 100644 (file)
@@ -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;