Plug a free basic memory leaks
authorJens Axboe <axboe@fb.com>
Tue, 11 Feb 2014 17:33:06 +0000 (10:33 -0700)
committerJens Axboe <axboe@fb.com>
Tue, 11 Feb 2014 17:33:06 +0000 (10:33 -0700)
Signed-off-by: Jens Axboe <axboe@fb.com>
cconv.c
init.c

diff --git a/cconv.c b/cconv.c
index 0d30f07..b7d469e 100644 (file)
--- a/cconv.c
+++ b/cconv.c
@@ -18,6 +18,29 @@ static void string_to_net(uint8_t *dst, const char *src)
                dst[0] = '\0';
 }
 
+void free_thread_options_to_cpu(struct thread_options *o)
+{
+       free(o->description);
+       free(o->name);
+       free(o->directory);
+       free(o->filename);
+       free(o->filename_format);
+       free(o->opendir);
+       free(o->ioengine);
+       free(o->mmapfile);
+       free(o->read_iolog_file);
+       free(o->write_iolog_file);
+       free(o->bw_log_file);
+       free(o->lat_log_file);
+       free(o->iops_log_file);
+       free(o->replay_redirect);
+       free(o->exec_prerun);
+       free(o->exec_postrun);
+       free(o->ioscheduler);
+       free(o->profile);
+       free(o->cgroup);
+}
+
 void convert_thread_options_to_cpu(struct thread_options *o,
                                   struct thread_options_pack *top)
 {
@@ -438,5 +461,7 @@ int fio_test_cconv(struct thread_options *__o)
        convert_thread_options_to_cpu(&o, &top1);
        convert_thread_options_to_net(&top2, &o);
 
+       free_thread_options_to_cpu(&o);
+
        return memcmp(&top1, &top2, sizeof(top1));
 }
diff --git a/init.c b/init.c
index b26dc9f..fa1df8e 100644 (file)
--- a/init.c
+++ b/init.c
@@ -250,6 +250,7 @@ void free_shm(void)
                free_threads_shm();
        }
 
+       options_free(fio_options, &def_thread);
        scleanup();
 }