]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Fix valgrind error: Mismatched free() / delete / delete []
authoreap <eap@opencascade.com>
Wed, 13 Dec 2017 13:51:53 +0000 (16:51 +0300)
committereap <eap@opencascade.com>
Wed, 13 Dec 2017 13:51:53 +0000 (16:51 +0300)
src/GEOM_I/GEOM_DumpPython.cc

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