Make verify_dump off by default
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index 27e7336b49af99720886905928a69058e42f3bf1..18e8a400c3d85dc90e89a4347f3d390c934c458b 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -273,6 +273,8 @@ void strip_blank_front(char **p)
 {
        char *s = *p;
 
+       if (!strlen(s))
+               return;
        while (isspace((int) *s))
                s++;
 
@@ -283,6 +285,9 @@ void strip_blank_end(char *p)
 {
        char *start = p, *s;
 
+       if (!strlen(p))
+               return;
+
        s = strchr(p, ';');
        if (s)
                *s = '\0';
@@ -1094,3 +1099,22 @@ void options_init(struct fio_option *options)
        for (o = &options[0]; o->name; o++)
                option_init(o);
 }
+
+void options_free(struct fio_option *options, void *data)
+{
+       struct fio_option *o;
+       char **ptr;
+
+       dprint(FD_PARSE, "free options\n");
+
+       for (o = &options[0]; o->name; o++) {
+               if (o->type != FIO_OPT_STR_STORE)
+                       continue;
+
+               ptr = td_var(data, o->off1);
+               if (*ptr) {
+                       free(*ptr);
+                       *ptr = NULL;
+               }
+       }
+}