journal: do not trigger assertion when journal_file_close() get NULL

We generally expect destructors to not complain if a NULL argument is passed.

Closes #12400.
This commit is contained in:
Yu Watanabe
2019-05-28 18:07:18 +09:00
parent 3fb1069019
commit c377a6f3ad
2 changed files with 4 additions and 6 deletions
+2 -1
View File
@@ -340,7 +340,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 */
+2 -5
View File
@@ -2232,11 +2232,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);