helper_thread: Initialize all helper_data members before using it
[fio.git] / helper_thread.c
index 9c6e0a2b52da53adc495c6a478c9e5509a25880c..b05f8212a6210e4cd9f00f6147759e3e5418249a 100644 (file)
@@ -134,8 +134,7 @@ static void *helper_thread_main(void *data)
                                        next_ss = STEADYSTATE_MSEC - (since_ss - STEADYSTATE_MSEC);
                                else
                                        next_ss = STEADYSTATE_MSEC;
-                       }
-                       else
+                       } else
                                next_ss = STEADYSTATE_MSEC - since_ss;
                 }
 
@@ -157,7 +156,7 @@ int helper_thread_create(struct fio_mutex *startup_mutex, struct sk_out *sk_out)
        struct helper_data *hd;
        int ret;
 
-       hd = smalloc(sizeof(*hd));
+       hd = scalloc(1, sizeof(*hd));
 
        setup_disk_util();
        steadystate_setup();