Skip to content
Snippets Groups Projects
Commit 6d7eb3a1 authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

CommandLineArguments: do not check variable before delete[]

parent e75d1a31
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -649,10 +649,7 @@ void CommandLineArguments::PopulateVariable(double* variable, ...@@ -649,10 +649,7 @@ void CommandLineArguments::PopulateVariable(double* variable,
void CommandLineArguments::PopulateVariable(char** variable, void CommandLineArguments::PopulateVariable(char** variable,
const std::string& value) const std::string& value)
{ {
if (*variable) { delete[] * variable;
delete[] * variable;
*variable = 0;
}
*variable = new char[value.size() + 1]; *variable = new char[value.size() + 1];
strcpy(*variable, value.c_str()); strcpy(*variable, value.c_str());
} }
......
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