[omniORB] omniORB 4.0.3 client side memory leak?

Mike Bendickson mike.bendickson at spanlink.com
Mon Feb 23 13:41:08 GMT 2004


In porting some code from omniORB 2.8.0 to 4.0.3, my client is getting exceptions and leaking memory.

Here is the offending code:

IDL:

.
.
.
        short test_outStrParamNotReturned(out string p_sTestOut);
.
.
.

The server impl looks something like this:

CORBA::Short
#if defined(_USE_OMNIORB280)
CIOmniORBImpl::test_outStrParamNotReturned(char *& p_sTestOut)
#elif defined(_USE_OMNIORB403)
CIOmniORBImpl::test_outStrParamNotReturned(CORBA::String_out p_sTestOut)
#endif
{
    std::cout << "Executing test_outStrParamNotReturned(...)" << std::endl;
//  p_sTestOut = CORBA::string_dup("test_outStrParamNotReturned");
    return (0);
}

Note that string_dup is commented out.  With 2.8, no client exception is thrown, and no leak is apparent.

In 4.0.3, I get a COMM_FAILURE exception, and it leaks memory (client side leak).

It's easily fixed by making sure that I always initialize the output string, but it seems like it might be a bug so I thought I'd report it.

-Mike



More information about the omniORB-list mailing list