@@ -1563,12 +1563,16 @@ int fwts_framework_args(const int argc, char **argv)
fw->results_logname,
(fw->flags & FWTS_FLAG_FORCE_CLEAN) ? "w" : "a",
fw->log_type)) == NULL) {
+ char *filenames = fwts_log_get_filenames(fw->results_logname, fw->log_type);
+
ret = FWTS_ERROR;
fprintf(stderr, "%s: Cannot open results log '%s'"
" (you may need to remove it to set proper"
" permissions).\n",
argv[0],
- fwts_log_get_filenames(fw->results_logname, fw->log_type));
+ filenames ? filenames : fw->results_logname);
+ if (filenames)
+ free(filenames);
goto tidy_close;
}