diff --git a/src/ior.c b/src/ior.c index 1fed65e..57c186c 100755 --- a/src/ior.c +++ b/src/ior.c @@ -499,7 +499,7 @@ static void* safeMalloc(uint64_t size){ return d; } -static void AllocResults(IOR_test_t *test) +void AllocResults(IOR_test_t *test) { int reps; if (test->results != NULL) @@ -533,7 +533,6 @@ IOR_test_t *CreateTest(IOR_param_t *init_params, int test_num) newTest->next = NULL; newTest->results = NULL; - AllocResults(newTest); return newTest; } diff --git a/src/ior.h b/src/ior.h index 43177fd..c283be7 100755 --- a/src/ior.h +++ b/src/ior.h @@ -228,6 +228,8 @@ typedef struct IOR_test_t { IOR_test_t *CreateTest(IOR_param_t *init_params, int test_num); +void AllocResults(IOR_test_t *test); + char * GetPlatformName(); void init_IOR_Param_t(IOR_param_t *p); diff --git a/src/parse_options.c b/src/parse_options.c index 80b99a3..8e8e773 100755 --- a/src/parse_options.c +++ b/src/parse_options.c @@ -396,6 +396,7 @@ IOR_test_t *ReadConfigScript(char *scriptName) /* previous line was a "run" as well create duplicate test */ tail->next = CreateTest(&tail->params, test_num++); + AllocResults(tail); tail = tail->next; } runflag = 1; @@ -404,6 +405,7 @@ IOR_test_t *ReadConfigScript(char *scriptName) create and initialize a new test structure */ runflag = 0; tail->next = CreateTest(&tail->params, test_num++); + AllocResults(tail); tail = tail->next; ParseLine(linebuf, &tail->params); } else { @@ -414,6 +416,7 @@ IOR_test_t *ReadConfigScript(char *scriptName) /* close the script */ if (fclose(file) != 0) ERR("fclose() of script file failed"); + AllocResults(head); return head; } @@ -565,6 +568,7 @@ IOR_test_t *ParseCommandLine(int argc, char **argv) tests = ReadConfigScript(testscripts); }else{ tests = CreateTest(&initialTestParams, 0); + AllocResults(tests); } CheckRunSettings(tests);