From: Jens Axboe Date: Fri, 20 Oct 2006 12:00:36 +0000 (+0200) Subject: [PATCH] Plug a few more leaks X-Git-Tag: fio-1.7^0 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=eecf272f1b2d55c1e49aadd7f65b9a433ba04c15 [PATCH] Plug a few more leaks Signed-off-by: Jens Axboe --- 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)