stat: collapse buf output flush and free
authorJens Axboe <axboe@fb.com>
Tue, 27 Oct 2015 09:16:12 +0000 (18:16 +0900)
committerJens Axboe <axboe@fb.com>
Tue, 27 Oct 2015 09:16:12 +0000 (18:16 +0900)
Signed-off-by: Jens Axboe <axboe@fb.com>
stat.c

diff --git a/stat.c b/stat.c
index 2c218158b8cd61aa2780acb6d412e7a42b4bb5b4..7fa601b72d0c3b2e6c449040cbe97f1ea9f60e1d 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -1627,15 +1627,14 @@ void __show_run_stats(void)
                show_idle_prof_stats(FIO_OUTPUT_NORMAL, NULL, &output[__FIO_OUTPUT_NORMAL]);
        }
 
                show_idle_prof_stats(FIO_OUTPUT_NORMAL, NULL, &output[__FIO_OUTPUT_NORMAL]);
        }
 
-       for (i = 0; i < FIO_OUTPUT_NR; i++)
+       for (i = 0; i < FIO_OUTPUT_NR; i++) {
                buf_output_flush(&output[i]);
                buf_output_flush(&output[i]);
+               buf_output_free(&output[i]);
+       }
 
        log_info_flush();
        free(runstats);
        free(threadstats);
 
        log_info_flush();
        free(runstats);
        free(threadstats);
-
-       for (i = 0; i < FIO_OUTPUT_NR; i++)
-               buf_output_free(&output[i]);
 }
 
 void show_run_stats(void)
 }
 
 void show_run_stats(void)