num2str: ensure we never access postfix[] out-of-bounds
[fio.git] / init.c
diff --git a/init.c b/init.c
index 7e456b20d3466d8c9b9e83858623833fa1d6ae6d..21779c7b162fda0dadeb9f2238d7a334f7c7f3db 100644 (file)
--- a/init.c
+++ b/init.c
@@ -942,7 +942,7 @@ static char *make_filename(char *buf, struct thread_options *o,
 {
        struct fpre_keyword *f;
        char copy[PATH_MAX];
-       size_t dst_left = PATH_MAX;
+       size_t dst_left = PATH_MAX - 1;
 
        if (!o->filename_format || !strlen(o->filename_format)) {
                sprintf(buf, "%s.%d.%d", jobname, jobnum, filenum);
@@ -1458,9 +1458,6 @@ int parse_jobs_ini(char *file, int is_buf, int stonewall_flag, int type)
                i++;
        }
 
-       for (i = 0; i < num_opts; i++)
-               free(opts[i]);
-
        free(string);
        free(name);
        free(opts);