From eecf272f1b2d55c1e49aadd7f65b9a433ba04c15 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 20 Oct 2006 14:00:36 +0200 Subject: [PATCH] [PATCH] Plug a few more leaks Signed-off-by: Jens Axboe --- eta.c | 3 ++- fio.c | 1 + stat.c | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/eta.c b/eta.c index b3d4434e..8cf9ea25 100644 --- a/eta.c +++ b/eta.c @@ -215,6 +215,8 @@ void print_thread_status(void) } } + free(eta_secs); + if (eta_sec != INT_MAX && elapsed) { perc = (double) elapsed / (double) (elapsed + eta_sec); eta_to_str(eta_str, eta_sec); @@ -232,7 +234,6 @@ void print_thread_status(void) } printf("\r"); fflush(stdout); - free(eta_secs); } void print_status_init(int thread_number) diff --git a/fio.c b/fio.c index bdfbd827..f81aec59 100644 --- a/fio.c +++ b/fio.c @@ -590,6 +590,7 @@ static void *thread_main(void *data) int ret = switch_ioscheduler(td); free(td->ioscheduler); + free(td->sysfs_root); if (ret) goto err; } diff --git a/stat.c b/stat.c index fc0abe0a..518d14dd 100644 --- a/stat.c +++ b/stat.c @@ -243,7 +243,9 @@ void init_disk_util(struct thread_data *td) sprintf(foo, "%s", tmp); } - td->sysfs_root = strdup(foo); + if (td->ioscheduler) + td->sysfs_root = strdup(foo); + disk_util_add(dev, foo); } @@ -524,6 +526,8 @@ void show_run_stats(void) show_disk_util(); } + + free(runstats); } static inline void add_stat_sample(struct io_stat *is, unsigned long val) -- 2.25.1