summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2006-10-20 14:00:36 +0200
committerJens Axboe <jens.axboe@oracle.com>2006-10-20 14:00:36 +0200
commiteecf272f1b2d55c1e49aadd7f65b9a433ba04c15 (patch)
tree585ab9a1efdb95e302c91c1678552148187acf76
parentb4a6a59a939f0e6554632de311e7d1d1b7633ccf (diff)
downloadfio-eecf272f1b2d55c1e49aadd7f65b9a433ba04c15.tar.gz
fio-eecf272f1b2d55c1e49aadd7f65b9a433ba04c15.tar.bz2
[PATCH] Plug a few more leaksfio-1.7
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--eta.c3
-rw-r--r--fio.c1
-rw-r--r--stat.c6
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)