From: Michal Schmidt Date: Tue, 12 Jun 2012 14:45:09 +0000 (+0200) Subject: journal-file: fix mmap leak X-Git-Tag: upstream-fixes_44-3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a465c085acbafd353ceea694831e597c5fbba51;p=systemd journal-file: fix mmap leak https://bugzilla.redhat.com/show_bug.cgi?id=831132 --- diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 5d540a7d..20a0193e 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -67,9 +67,12 @@ void journal_file_close(JournalFile *f) { assert(f); - if (f->header && f->writable) - f->header->state = STATE_OFFLINE; + if (f->header) { + if (f->writable) + f->header->state = STATE_OFFLINE; + munmap(f->header, PAGE_ALIGN(sizeof(Header))); + } for (t = 0; t < _WINDOW_MAX; t++) if (f->windows[t].ptr)