Fix valgrind error: Mismatched free() / delete / delete []

This commit is contained in:
eap 2017-12-13 16:51:53 +03:00
parent 2736f682fe
commit dbb1bb16ca

View File

@ -134,10 +134,10 @@ Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
anAttrStr = SALOMEDS::AttributeString::_narrow(anAttr); anAttrStr = SALOMEDS::AttributeString::_narrow(anAttr);
SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(anAttrStr->Value()); SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(anAttrStr->Value());
ObjectStates* aStates = new ObjectStates(); ObjectStates* aStates = new ObjectStates();
for(int i = 0; i < aSections->length(); i++) { for( CORBA::ULong i = 0; i < aSections->length(); i++) {
TState aState; TState aState;
SALOMEDS::ListOfStrings aListOfVars = aSections[i]; SALOMEDS::ListOfStrings aListOfVars = aSections[i];
for(int j = 0; j < aListOfVars.length(); j++) { for( CORBA::ULong j = 0; j < aListOfVars.length(); j++) {
bool isVar = aStudy->IsVariable(aListOfVars[j].in()); bool isVar = aStudy->IsVariable(aListOfVars[j].in());
TVariable aVar = TVariable( (char*)aListOfVars[j].in(), isVar ); TVariable aVar = TVariable( (char*)aListOfVars[j].in(), isVar );
aState.push_back(aVar); aState.push_back(aVar);
@ -282,7 +282,7 @@ char* GEOM_Gen_i::GetDumpName (const char* theStudyEntry)
{ {
const char* name = _impl->GetDumpName( theStudyEntry ); const char* name = _impl->GetDumpName( theStudyEntry );
if ( name && strlen( name ) > 0 ) if ( name && strlen( name ) > 0 )
return strdup( name ); return CORBA::string_dup( name );
return NULL; return NULL;
} }