« Return to Thread: Memory leak on CORBA_String_dup

Re: Memory leak on CORBA_String_dup

by Jules Colding :: Rate this Message:

Reply to Author | View in Thread

Hi arijit,

On 28/07/2008, at 14.28, arijit wrote:

> On 28/07/2008, at 11.29, arijit wrote:
>
>> Hi,
>>  I am using ORBit2 on server side and OpenORB on the client side.
>> The ORBit2 returns a string by doing CORBA_String_sup of a const
>> char *. In OpenORB, I take care of making sure the retruned value is
>> null-ified (though, I believe, it cannot contribute to the server
>> leaking memory!!).
>>  I have confirmed that the leak is with the String being passed,
>> by, increasing the size of the String being returned, and seeing the
>> server leak increasing significantly!
>>  Am I missing something, or am I going horribly wrong somewhere?
>>  Any help is much appreciated!!
>
> Seeing the server side method code will help.
>
> Best regards,
>   jules
>
> Hi,
>  Here is the code snippet:
>
> static uancorba_SessionID
> impl_uancorba_SessionManager_createConfigSession
> (impl_POA_uancorba_SessionManager *servant,
> CORBA_Environment *ev)
> {
>        uancorba_SessionID retval;
>          retval = CORBA_string_dup("TEST THIS OUT FIRST");
>            return (retval);
> }
>
> In the idl, SessionID is defined, thus:
> module uancorba {
>
>  /**
>   * The SessionID is a unique identifier used to represent the  
> user's session.
>   */
>  typedef string SessionID;
> .....
>
> }
>
> I am using ORBit2 version number: 2.12.4.

Your code is correct and should not leak but you are using an ancient  
version of ORBit2. Please try again with something newer like "2.14.13".

Best regards,
   jules


_______________________________________________
orbit-list mailing list
orbit-list@...
http://mail.gnome.org/mailman/listinfo/orbit-list

 « Return to Thread: Memory leak on CORBA_String_dup