mirror of
https://github.com/nasa/trick.git
synced 2025-01-18 18:56:31 +00:00
free memory leaks MonteVarFile.cpp
This commit is contained in:
parent
7b3b47aa39
commit
2cdd4bf380
@ -77,6 +77,9 @@ std::string Trick::MonteVarFile::get_next_value() {
|
||||
}
|
||||
|
||||
// Get the next value.
|
||||
if(temp_str) {
|
||||
free(temp_str);
|
||||
}
|
||||
temp_str = strdup(line.c_str());
|
||||
token = strtok(temp_str, " \t");
|
||||
|
||||
@ -97,6 +100,10 @@ std::string Trick::MonteVarFile::get_next_value() {
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
if(temp_str) {
|
||||
free(temp_str);
|
||||
temp_str = nullptr;
|
||||
}
|
||||
char string[100];
|
||||
sprintf(string, "Trick:MonteVarFile the input file \"%s\" is not open for reading", file_name.c_str());
|
||||
exec_terminate_with_return(-1, __FILE__, __LINE__, string);
|
||||
|
Loading…
Reference in New Issue
Block a user