chiark / gitweb /
journal: don't access j->files after use
authorLennart Poettering <lennart@poettering.net>
Sat, 23 Mar 2013 03:11:23 +0000 (04:11 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 23 Mar 2013 03:14:20 +0000 (04:14 +0100)
https://bugs.freedesktop.org/show_bug.cgi?id=62605

src/journal/sd-journal.c

index f7f1777..82cacf3 100644 (file)
@@ -1658,6 +1658,8 @@ _public_ void sd_journal_close(sd_journal *j) {
         if (!j)
                 return;
 
+        sd_journal_flush_matches(j);
+
         while ((f = hashmap_steal_first(j->files)))
                 journal_file_close(f);
 
@@ -1675,8 +1677,6 @@ _public_ void sd_journal_close(sd_journal *j) {
         if (j->inotify_fd >= 0)
                 close_nointr_nofail(j->inotify_fd);
 
-        sd_journal_flush_matches(j);
-
         if (j->mmap)
                 mmap_cache_unref(j->mmap);