diff --git a/src/MainUtils.cpp b/src/MainUtils.cpp index 8071908..944b1d5 100644 --- a/src/MainUtils.cpp +++ b/src/MainUtils.cpp @@ -107,8 +107,8 @@ void outputCode( // Start a separate process to redirect the model output. I/O redirection // changes will not be visible to the parent process. if (fork() == 0) { - const char * tempFilename = (filename + extension).c_str(); - freopen(tempFilename, "w", stderr); + string tempFilename = filename + extension; + freopen(tempFilename.c_str(), "w", stderr); module->dump(); fclose(stderr); exit(0);