Skip to content
Snippets Groups Projects
Commit 5d787f7f authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

avoid tiny memory leak, when the restart command is specified multiple times

parent c8f4b555
No related branches found
No related tags found
No related merge requests found
...@@ -749,6 +749,7 @@ void Output::create_restart(int narg, char **arg) ...@@ -749,6 +749,7 @@ void Output::create_restart(int narg, char **arg)
} else restart_every_single = every; } else restart_every_single = every;
int n = strlen(arg[1]) + 3; int n = strlen(arg[1]) + 3;
delete [] restart1;
restart1 = new char[n]; restart1 = new char[n];
strcpy(restart1,arg[1]); strcpy(restart1,arg[1]);
if (strchr(restart1,'*') == NULL) strcat(restart1,".*"); if (strchr(restart1,'*') == NULL) strcat(restart1,".*");
...@@ -765,6 +766,8 @@ void Output::create_restart(int narg, char **arg) ...@@ -765,6 +766,8 @@ void Output::create_restart(int narg, char **arg)
restart_every_double = 0; restart_every_double = 0;
} else restart_every_double = every; } else restart_every_double = every;
delete [] restart2a;
delete [] restart2b;
restart_toggle = 0; restart_toggle = 0;
int n = strlen(arg[1]) + 3; int n = strlen(arg[1]) + 3;
restart2a = new char[n]; restart2a = new char[n];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment