axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jared Hanson" <jaredhan...@gmail.com>
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
soap_over_http_sender.

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: 192.168.10.32:40547 <-> 192.168.1.230:2757
==4430==    at 0x1BB497A2: socket (in /lib/libc-2.3.2.so)
==4430==    by 0x818F228: axis2_http_client_send (http_client.c:325)
==4430==    by 0x818C1FB: axis2_soap_over_http_sender_send
(soap_over_http_sender.c:491)
==4430==    by 0x818B23C: axis2_http_transport_sender_write_message
(http_transport_sender.c:615)
==4430==    by 0x818A535: axis2_http_transport_sender_invoke
(http_transport_sender.c:280)
==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
/home/build/CENTRAL-20070222/central/app/src/asperacentral)
==4430==    by 0x1B93AE50: pthread_start_thread (in /lib/libpthread-0.10.so)
==4430==    by 0x1BB488A9: clone (in /lib/libc-2.3.2.so)

Mime
View raw message