Commit dc29cbda authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot
Browse files

Merge topic 'fix_xmdf_mem_leaks'

1da9c651

 fix some memory leaks related to xdmf
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !4485
parents 6a58312b 1da9c651
Pipeline #109154 canceled with stage
in 0 seconds
......@@ -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