We generally expect destructors to not complain if a NULL argument is passed.
Closes #12400.
(cherry picked from commit
c377a6f3ad3d9bed4ce7e873e8e9ec6b1650c57d)
Gbp-Pq: Name journal-do-not-trigger-assertion-when-journal_file_close-.patch
}
JournalFile* journal_file_close(JournalFile *f) {
- assert(f);
+ if (!f)
+ return NULL;
#if HAVE_GCRYPT
/* Write the final tag */
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);