[omniORB] bind_new_context() on LINUX

Bjorn Rohde Jensen shamus@tdcadsl.dk
Sat, 15 Dec 2001 13:05:37 +0100


Hi,

 I believe, the SEGV is due to a slight problem with your use of
the contextName. You are assigning to a pointer type in CosNameing::Name
and thus yielding ownership of the const char * to it. contextName now
believes, it holds a pointer dynamically allocated using string_dup(..)
and will eventually try to free it, which, if i am correct, results in
undefined behavior.

Yours sincerely,

bjorn


>                 contextName[0].id = (const char*) "test"; // string copied
>                 contextName[0].kind = (const char*) "my_context"; // string copied