Commit d1910f24 authored by Ken Martin's avatar Ken Martin

a few more memory leak coverity fixes etc

various coverity fixes
parent bfbdc62b
Pipeline #3874 passed with stage
......@@ -763,7 +763,11 @@ void vtkPlotBar::SetColor(double r, double g, double b)
//-----------------------------------------------------------------------------
void vtkPlotBar::GetColor(double rgb[3])
{
this->Brush->GetColorF(rgb);
double rgba[4];
this->Brush->GetColorF(rgba);
rgb[0] = rgba[0];
rgb[1] = rgba[1];
rgb[2] = rgba[2];
}
//-----------------------------------------------------------------------------
......
......@@ -1198,6 +1198,7 @@ void vtkImageToPolyDataFilter::BuildPolygons(vtkUnsignedCharArray *vtkNotUsed(po
if (ncells < 2)
{
vtkErrorMacro(<<"Bad mojo");
delete [] polyVisited;
return;
}
//for each edge, walk around polygon (if not visited before)
......
......@@ -890,6 +890,7 @@ void vtkMultiCorrelativeStatistics::SelectAssessFunctor( vtkTable* inData,
if ( ! mcfunc->Initialize( inData, reqModel ) )
{
delete mcfunc;
return;
}
dfunc = mcfunc;
}
......@@ -456,6 +456,7 @@ void vtkBMPReaderUpdate2(vtkBMPReader *self, vtkImageData *data, OT *outPtr)
{
if (!self->OpenAndSeekFile(dataExtent,idx2))
{
delete [] buf;
return;
}
}
......
......@@ -1284,7 +1284,6 @@ void vtkTIFFReader::ReadGenericImage(T* out, unsigned int, unsigned int height)
}
unsigned int isize = TIFFScanlineSize(this->InternalImage->Image);
tdata_t buf = _TIFFmalloc(isize);
if (this->InternalImage->PlanarConfig != PLANARCONFIG_CONTIG)
{
......@@ -1292,6 +1291,8 @@ void vtkTIFFReader::ReadGenericImage(T* out, unsigned int, unsigned int height)
return;
}
tdata_t buf = _TIFFmalloc(isize);
T* image;
if (this->InternalImage->PlanarConfig == PLANARCONFIG_CONTIG)
{
......
......@@ -355,6 +355,7 @@ void vtkVolume16Reader::ReadVolume(int first, int last,
if ( !(fp = fopen(filename,"rb")) )
{
vtkErrorMacro(<<"Can't find file: " << filename);
delete [] slice;
return;
}
......
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