Fixed Coverity reported issue.
CID 11388: Resource leak in object (CTOR_DTOR_LEAK) Allocating memory by calling "new char[numBytes]". Assigning: "this->_startPtr" = "new char[numBytes]". The constructor allocates field "_startPtr" of "struct DataConverter" but there is no destructor. Assigning: "this->_currentPtr" = "new char[numBytes]". The constructor allocates field "_currentPtr" of "struct DataConverter" but there is no destructor.
This commit is contained in:
@@ -918,15 +918,15 @@ int main( int argc, char **argv )
|
||||
scratchPad.reset();
|
||||
scratchPad.read(cp);
|
||||
|
||||
bc.setBuffer(scratchPad._startPtr, scratchPad._numBytes);
|
||||
bc.setBuffer(scratchPad.startPtr(), scratchPad.numBytes());
|
||||
|
||||
std::cout << "bc.sync()"<<scratchPad._numBytes<<std::endl;
|
||||
std::cout << "bc.sync()"<<scratchPad.numBytes()<<std::endl;
|
||||
|
||||
bc.sync();
|
||||
}
|
||||
else if (P3DApplicationType==SLAVE)
|
||||
{
|
||||
rc.setBuffer(scratchPad._startPtr, scratchPad._numBytes);
|
||||
rc.setBuffer(scratchPad.startPtr(), scratchPad.numBytes());
|
||||
|
||||
rc.sync();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user