sd-journal: fix potential memory leak
Though, hopefully, the memory leak is hypothetical, as we always close journal file with the timer by journal_file_offline_close().
This commit is contained in:
@@ -281,6 +281,8 @@ JournalFile* journal_file_close(JournalFile *f) {
|
||||
|
||||
assert(f->newest_boot_id_prioq_idx == PRIOQ_IDX_NULL);
|
||||
|
||||
sd_event_source_disable_unref(f->post_change_timer);
|
||||
|
||||
if (f->cache_fd)
|
||||
mmap_cache_fd_free(f->cache_fd);
|
||||
|
||||
|
||||
@@ -399,7 +399,7 @@ JournalFile* journal_file_offline_close(JournalFile *f) {
|
||||
|
||||
if (sd_event_source_get_enabled(f->post_change_timer, NULL) > 0)
|
||||
journal_file_post_change(f);
|
||||
sd_event_source_disable_unref(f->post_change_timer);
|
||||
f->post_change_timer = sd_event_source_disable_unref(f->post_change_timer);
|
||||
|
||||
journal_file_set_offline(f, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user