Fix leak of string when doing parse dryrun
authorJens Axboe <axboe@fb.com>
Fri, 11 Apr 2014 17:25:32 +0000 (11:25 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 11 Apr 2014 17:25:32 +0000 (11:25 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
options.c

index ae04b3bb914043d4cc44e992f832c06cbba8e8ca..5c372b6964c0eb078737732131cbbb63c7541f10 100644 (file)
--- a/options.c
+++ b/options.c
@@ -322,7 +322,7 @@ static int str_rw_cb(void *data, const char *str)
 {
        struct thread_data *td = data;
        struct thread_options *o = &td->o;
 {
        struct thread_data *td = data;
        struct thread_options *o = &td->o;
-       char *nr = get_opt_postfix(str);
+       char *nr;
 
        if (parse_dryrun())
                return 0;
 
        if (parse_dryrun())
                return 0;
@@ -330,6 +330,7 @@ static int str_rw_cb(void *data, const char *str)
        o->ddir_seq_nr = 1;
        o->ddir_seq_add = 0;
 
        o->ddir_seq_nr = 1;
        o->ddir_seq_add = 0;
 
+       nr = get_opt_postfix(str);
        if (!nr)
                return 0;
 
        if (!nr)
                return 0;