10 Jan 2011 14:12
Memory leak in create_reference_with_id
Felipe Magno de Almeida <eu <at> felipemagno.com.br>
2011-01-10 13:12:54 GMT
2011-01-10 13:12:54 GMT
Hi,
The mico 2.3.13 has the following code for
POA_impl::create_reference_with_id in poa_impl.cc:2848.
CORBA::Object_ptr
MICOPOA::POA_impl::create_reference_with_id (const
PortableServer::ObjectId & id,
const char * repoid)
{
assert (repoid);
POAObjectReference * por = new POAObjectReference (this, id, repoid);
CORBA::Object_ptr obj = por->ref();
if (id_assignment_policy->value() == PortableServer::SYSTEM_ID
&& CORBA::is_nil(obj)) {
// it seems that supplied object id
// was not generated by this orb/poa
mico_throw(CORBA::BAD_PARAM(14, CORBA::COMPLETED_NO));
}
assert (!CORBA::is_nil (obj));
delete por;
return obj;
}
We can see that if mico_throw is executed, then the statement delete
is never executed, causing por to leak.
Regards,
--
--
(Continue reading)
RSS Feed