From 5de463a68d8d935a72ddaf788108c5b18d87408c Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 19 Jun 2013 14:25:16 +0000 Subject: [PATCH] 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 --- src/GEOM_I/GEOM_Object_i.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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() ); } //============================================================================= -- 2.39.2