[PATCH] Revert some of the leak fixes
authorJens Axboe <jens.axboe@oracle.com>
Tue, 24 Oct 2006 07:33:42 +0000 (09:33 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 24 Oct 2006 07:33:42 +0000 (09:33 +0200)
If the options are given as part of the global thread, the others
inherit the memory and thus cannot free it. Since it doesn't matter
a lot (we are talking a few hundred bytes), just leave the memory
as-is.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c
log.c

diff --git a/fio.c b/fio.c
index f81aec599a6a6709be28f205c094a20a86e6bfdf..5673d9ef690cc8e8c6d6bbe31dccc5fb3cc937ba 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -586,14 +586,8 @@ static void *thread_main(void *data)
        if (init_random_state(td))
                goto err;
 
        if (init_random_state(td))
                goto err;
 
-       if (td->ioscheduler) {
-               int ret = switch_ioscheduler(td);
-
-               free(td->ioscheduler);
-               free(td->sysfs_root);
-               if (ret)
-                       goto err;
-       }
+       if (td->ioscheduler && switch_ioscheduler(td))
+               goto err;
 
        td_set_runstate(td, TD_INITIALIZED);
        fio_sem_up(&startup_sem);
 
        td_set_runstate(td, TD_INITIALIZED);
        fio_sem_up(&startup_sem);
@@ -604,10 +598,8 @@ static void *thread_main(void *data)
 
        gettimeofday(&td->epoch, NULL);
 
 
        gettimeofday(&td->epoch, NULL);
 
-       if (td->exec_prerun) {
+       if (td->exec_prerun)
                system(td->exec_prerun);
                system(td->exec_prerun);
-               free(td->exec_prerun);
-       }
 
        while (td->loops--) {
                getrusage(RUSAGE_SELF, &td->ru_start);
 
        while (td->loops--) {
                getrusage(RUSAGE_SELF, &td->ru_start);
@@ -656,10 +648,8 @@ static void *thread_main(void *data)
                finish_log(td, td->clat_log, "clat");
        if (td->write_iolog)
                write_iolog_close(td);
                finish_log(td, td->clat_log, "clat");
        if (td->write_iolog)
                write_iolog_close(td);
-       if (td->exec_postrun) {
+       if (td->exec_postrun)
                system(td->exec_postrun);
                system(td->exec_postrun);
-               free(td->exec_postrun);
-       }
 
        if (exitall_on_terminate)
                terminate_threads(td->groupid);
 
        if (exitall_on_terminate)
                terminate_threads(td->groupid);
diff --git a/log.c b/log.c
index 91ac0830582625af31a8c78c730ee78ffc53ccd8..17a4cdf782c9b02c7c897454abcae6bf66dec34e 100644 (file)
--- a/log.c
+++ b/log.c
@@ -177,8 +177,6 @@ int init_iolog(struct thread_data *td)
        else if (td->write_iolog)
                ret = init_iolog_write(td);
 
        else if (td->write_iolog)
                ret = init_iolog_write(td);
 
-       free(td->iolog_file);
-       td->iolog_file = NULL;
        return 0;
 }
 
        return 0;
 }