t/zbd: avoid test case 31 failure with small devices
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index d086ee488f956048ff654082e8717ed49f5347df..656a50250b43cb09712de51fc2876c2aaefd5d65 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -601,7 +601,7 @@ static int __handle_option(const struct fio_option *o, const char *ptr,
        }
        case FIO_OPT_STR_VAL_TIME:
                is_time = 1;
-               fallthrough;
+               fio_fallthrough;
        case FIO_OPT_ULL:
        case FIO_OPT_INT:
        case FIO_OPT_STR_VAL:
@@ -817,6 +817,8 @@ store_option_value:
 
                if (o->off1) {
                        cp = td_var(data, o, o->off1);
+                       if (*cp)
+                               free(*cp);
                        *cp = strdup(ptr);
                        if (strlen(ptr) > o->maxlen - 1) {
                                log_err("value exceeds max length of %d\n",
@@ -978,7 +980,7 @@ store_option_value:
        }
        case FIO_OPT_DEPRECATED:
                ret = 1;
-               fallthrough;
+               fio_fallthrough;
        case FIO_OPT_SOFT_DEPRECATED:
                log_info("Option %s is deprecated\n", o->name);
                break;