[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster] A fix for a handle leak



Thanks for this,
it is added and commited,

regards
Marcel

Cazier, James wrote:

I do not know where to post this but I have found a leak in the corbaconnection.cpp file and wanted to post it and the fix.

I am using XMLBlaster 1.2 and the file is
client\protocol\corba\CorbaConnection.cpp

In the initAuthenticationService() function on line 178 a socket is
created. int s = socket(AF_INET, SOCK_STREAM, 0);


Then it is connected (or attempted) on line 180.
connect(s, (struct sockaddr *)&xmlBlasterAddr,
sizeof(xmlBlasterAddr)


After either a failure or success the socket is shutdown on line 209.
        shutdown(s, 2);

The problem is that the socket is not closed.  The leak occurs then if I
lose my network connection to the XMLBLaster server or if the server is
shutdown (or crashes) I get continual boot strap errors and every time 2
handles are leaked when the connection is attempted to be restored.

I fixed this by adding right after the shutdown(s, 2);
::closesocket(s);

This seems to have no side effect to the negative and I no longer am
having uncontrolled handle growth.
James Cazier
Software Engineer


Barco N.V.
Noordlaan 5
8520 Kuurne
Belgium
james.cazier at barco.com <mailto:james.cazier at barco.com>

- - - - - - - DISCLAIMER- - - - - - - -
Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you.