1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 10:51:20 +03:00

journal-file: fix mmap leak

https://bugzilla.redhat.com/show_bug.cgi?id=831132
This commit is contained in:
Michal Schmidt 2012-06-12 16:45:09 +02:00
parent 2154761fbb
commit d384c7a874

View File

@ -67,9 +67,12 @@ void journal_file_close(JournalFile *f) {
assert(f); assert(f);
if (f->header && f->writable) if (f->header) {
f->header->state = STATE_OFFLINE; if (f->writable)
f->header->state = STATE_OFFLINE;
munmap(f->header, PAGE_ALIGN(sizeof(Header)));
}
for (t = 0; t < _WINDOW_MAX; t++) for (t = 0; t < _WINDOW_MAX; t++)
if (f->windows[t].ptr) if (f->windows[t].ptr)