axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jared Hanson" <>
Subject Patch for sock handle and mem leak fix
Date Fri, 23 Feb 2007 01:43:36 GMT
Attached is a patch to fix a socket handle and memory leak in

It owns an http_client (sender_impl->client).  This was not being free'd,
and previously had a comment that said not to, because it will be required
in later processing of the message.  I stepped through the code, and could
not find such a scenario.  The only thing that looked risky, was that
http_client has a http_simple_response, which in turn has an in_stream (the
response).  This in_stream has ownership transferred to the msg_ctx.

I applied this patch and ran a number of request/response cycles, and didn't
detect any ill effects.  Someone familiar with this error of the code should
review this, in case I'm missing something.  Regardless, there is a socket
handle leak which is quite severe.

Here is the relevant valgrind output which identifies the issue:
==4430== Open AF_INET socket 376: <->
==4430==    at 0x1BB497A2: socket (in /lib/
==4430==    by 0x818F228: axis2_http_client_send (http_client.c:325)
==4430==    by 0x818C1FB: axis2_soap_over_http_sender_send
==4430==    by 0x818B23C: axis2_http_transport_sender_write_message
==4430==    by 0x818A535: axis2_http_transport_sender_invoke
==4430==    by 0x814F9F8: axis2_engine_send (engine.c:330)
==4430==    by 0x8184D33: axis2_mep_client_two_way_send (mep_client.c:637)
==4430==    by 0x81864F2: axis2_op_client_worker_func (op_client.c:758)
==4430==    by 0x81C168E: dummy_worker (in
==4430==    by 0x1B93AE50: pthread_start_thread (in /lib/
==4430==    by 0x1BB488A9: clone (in /lib/

View raw message