From: eap Date: Wed, 19 Jun 2013 14:25:16 +0000 (+0000) Subject: 0022232: [CEA 837] Memory corruption in GEOM/SMESH that leads to segfault on debian64 X-Git-Tag: BR_hydro_v_0_3_1~178 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5de463a68d8d935a72ddaf788108c5b18d87408c;p=modules%2Fgeom.git 0022232: [CEA 837] Memory corruption in GEOM/SMESH that leads to segfault on debian64 Fix "Mismatched free() / delete / delete []" valgrind error - fix GEOM_Object_i::GetName() as GEOM_Object::GetName() now returns TCollection_AsciiString --- diff --git a/src/GEOM_I/GEOM_Object_i.cc b/src/GEOM_I/GEOM_Object_i.cc index 3d1e9c686..6b243bd59 100644 --- a/src/GEOM_I/GEOM_Object_i.cc +++ b/src/GEOM_I/GEOM_Object_i.cc @@ -207,10 +207,8 @@ void GEOM_Object_i::SetName(const char* theName) //============================================================================= char* GEOM_Object_i::GetName() { - char* aName = _impl->GetName(); - if (aName) - return aName; // this is already copy of pointer (see implementation of _impl) - return CORBA::string_dup(""); + TCollection_AsciiString aName = _impl->GetName(); + return CORBA::string_dup( aName.ToCString() ); } //=============================================================================