[systemd-commits] src/journal

Michal Schmidt michich at kemper.freedesktop.org
Tue Jun 12 07:47:51 PDT 2012


 src/journal/journal-file.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit d384c7a8741aa5dda89c6eee63bfa3107181ee17
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Tue Jun 12 16:45:09 2012 +0200

    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 5dd6e57..1f82191 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)



More information about the systemd-commits mailing list