summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-06-12 16:45:09 +0200
committerMichal Schmidt <mschmidt@redhat.com>2012-06-12 16:46:34 +0200
commitd384c7a8741aa5dda89c6eee63bfa3107181ee17 (patch)
treedcde839039594c3d9dd533a1dbc920f5eca8afd2 /src/journal
parent2154761fbbc931e3e3d83100fa42609c99cd2536 (diff)
journal-file: fix mmap leak
https://bugzilla.redhat.com/show_bug.cgi?id=831132
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journal-file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 5dd6e575fb..1f82191d28 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)