Commit 1da9c651 authored by Ken Martin's avatar Ken Martin

fix some memory leaks related to xdmf

Fixed a couple reported memory leaks
The code looks like there may be more, potentially a lot more
but I'll see how this fares.
parent 23ec83e4
......@@ -77,6 +77,7 @@ int TestTemporalXdmfReaderWriter(int argc, char *argv[])
"Data/XDMF/temporalStaticMeshes.xmf");
vtkNew<vtkXdmfReader> reader;
reader->SetFileName(filePath);
delete [] filePath;
if (TestStaticMesh(reader) == VTK_ERROR)
{
std::cerr << "Error while reading " << reader->GetFileName() << std::endl;
......
......@@ -76,16 +76,21 @@ XdmfInt32 XdmfTime::UpdateInformation(){
}else{
if(attribute){
XdmfErrorMessage("Unknown Time Type : " << attribute);
free((void*)attribute);
return(XDMF_FAIL);
}
// Default
this->TimeType = XDMF_TIME_SINGLE;
}
if(attribute){
free((void*)attribute);
}
// Type == Function ?
attribute = this->Get("Function");
if(attribute){
this->TimeType = XDMF_TIME_FUNCTION;
this->SetFunction(attribute);
free((void*)attribute);
return(XDMF_SUCCESS);
}
attribute = this->Get("Value");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment