summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/journal/journal-file.c3
-rw-r--r--src/journal/journald-server.c7
2 files changed, 4 insertions, 6 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index efc3ee052b..8249b11b23 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -335,7 +335,8 @@ bool journal_file_is_offlining(JournalFile *f) {
}
JournalFile* journal_file_close(JournalFile *f) {
- assert(f);
+ if (!f)
+ return NULL;
#if HAVE_GCRYPT
/* Write the final tag */
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 6aecb67d6c..6250eab831 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -1906,11 +1906,8 @@ void server_done(Server *s) {
client_context_flush_all(s);
- if (s->system_journal)
- (void) journal_file_close(s->system_journal);
-
- if (s->runtime_journal)
- (void) journal_file_close(s->runtime_journal);
+ (void) journal_file_close(s->system_journal);
+ (void) journal_file_close(s->runtime_journal);
ordered_hashmap_free_with_destructor(s->user_journals, journal_file_close);