iolog: fix --bandwidth-log segfaults
[fio.git] / iolog.c
diff --git a/iolog.c b/iolog.c
index 6576ca55237e58668bb892d1f4b1ec227eaef515..ab9c87881a0a98feb1fcd99faa4458e59ad711ec 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -1065,7 +1065,7 @@ void flush_log(struct io_log *log, bool do_append)
                cur_log = flist_first_entry(&log->io_logs, struct io_logs, list);
                flist_del_init(&cur_log->list);
                
-               if (log == log->td->clat_hist_log)
+               if (log->td && log == log->td->clat_hist_log)
                        flush_hist_samples(f, log->hist_coarseness, cur_log->log,
                                           log_sample_sz(log, cur_log));
                else